Url

Ecng.Net

Represents a URL and provides functionality for URL manipulation and cloning.

Inherits: Uri

Implements: ICloneable<Url>, ICloneable

Constructors

Url
public Url(Uri url)
url = Url(url)

Initializes a new instance of the Url class using the specified Uri.

url
The Uri to initialize the URL from.
Url
public Url(string url)
url = Url(url)

Initializes a new instance of the Url class using the specified URL string.

url
The URL string.
Url
public Url(string basePart, string relativePart)
url = Url(basePart, relativePart)

Initializes a new instance of the Url class by combining a base URL and a relative URL.

basePart
The base URL as a string.
relativePart
The relative URL string.
Url
public Url(Uri basePart, string relativePart)
url = Url(basePart, relativePart)

Initializes a new instance of the Url class by combining a base Uri and a relative URL string.

basePart
The base Uri.
relativePart
The relative URL string.

Properties

Encode
public UrlEncodes Encode { get; set; }
value = url.Encode
url.Encode = value

Gets or sets the type of encoding to apply on the URL.

KeepDefaultPage
public bool KeepDefaultPage { get; set; }
value = url.KeepDefaultPage
url.KeepDefaultPage = value

Gets or sets a value indicating whether the default page should be kept in the URL.

QueryString
public QueryString QueryString { get; }
value = url.QueryString

Gets the query string associated with the URL.

Methods

Clone
public Url Clone()
result = url.Clone()

Creates a new instance of the Url class that is a copy of the current instance.

Returns: A new Url that is a copy of this instance.

System#ICloneable#Clone()

Creates a new object that is a copy of the current instance.

Returns: A new Url that is a copy of this instance.