Click or drag to resize

UrlParser Class

The UrlParser class represents a URL string and its separate components. It can be assigned a full string to the UrlParser via the Url property, or it can be accessed through separate parts of the URL via the individual properties.
Inheritance Hierarchy
SystemObject
  Crestron.SimplSharp.Net.HttpUrlParser

Namespace: Crestron.SimplSharp.Net.Http
Assembly: SimplSharpHelperInterface (in SimplSharpHelperInterface.dll) Version: 2.21.121
Syntax
C#
public class UrlParser

The UrlParser type exposes the following members.

Constructors
 NameDescription
Public methodUrlParser URL parser default constructor. Sets Protocol and port by default.
Public methodUrlParser(String) URL parser constructor with URL parameter that parses the input URL.
Public methodUrlParser(UrlParser, String) URL parser constructor with the base and the relative URL
Top
Properties
 NameDescription
Public propertyFragment The Fragment property gets any text following a fragment marker (#) in the URL, including the fragment marker itself.
Public propertyHostname Get the HostName.
Public propertyHostnameAndPort Combined Hostname and Port of the URL ("www.website.com:81"). The Port and the separating colon will only be included if the Port value is different from the default port for the specified protocol.
Public propertyHostnameType Get Hostname type
Public propertyIsAbsoluteUri The AbsoluteUrl property includes the entire URL stored in the Url instance, including all fragments and query strings.
Public propertyIsDefaultPort Gets whether the port value of the URL is the default for this scheme.
Public propertyIsFile Gets a value indicating whether the specified Url is a file URL.
Public propertyIsLoopback Gets whether the specified Url references the local host.
Public propertyIsUnc The IsUnc property is true if the specified Url instance is a UNC path (such as \\server\folder or file://server/folder). This property always returns true if the URL has the file:// scheme and specifies a host component.
Public propertyParams Parameters portion of the URL ("?query=something").
Public propertyPath Path portion of the URL ("/test.asp)
Public propertyPathAndParams Combined Path and Parameters of the URL ("test.pas?query=something"). The Parameters and the separating questionmark will only be included if the Params value is assigned.
Public propertyPort Port portion of the URL ("81").
Public propertyProtocol Protocol portion of the URL ("http").
Public propertyUrl The full URL. Only the relevant parts of the URL will be included; the Port will be omitted if it is equal to the default for the specified Protocol, Path and Params will be omitted if they are not assigned.
Public propertyUrl_Orig The full URL as provided by the user
Top
Methods
 NameDescription
Public methodEqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object)
Public methodGetHashCodeServes as the default hash function.
(Inherited from Object)
Public methodGetTypeGets the Type of the current instance.
(Inherited from Object)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
Public methodParse(String) Parses the URL and sets the proper definitions for all aspects of the URL
Public methodParse(UrlParser, String) Parses the URL and sets the proper definitions for all aspects of the URL base plus the relative URL
Public methodToString Returns the URL as a string.
(Overrides ObjectToString)
Top

Version Information

.NET

Supported in: 6.0

.NET Compact Framework

Supported in: 3.5
See Also