C# Uri Uri(String, UriKind)
Description
Uri Uri(String, UriKind)
initializes a new instance
of the Uri class with the specified URI. This constructor allows you to specify
if the URI string is a relative URI, absolute URI, or is indeterminate.
Syntax
Uri.Uri(String, UriKind)
has the following syntax.
public Uri(
string uriString,
UriKind uriKind
)
Parameters
Uri.Uri(String, UriKind)
has the following parameters.
uriString
- A string that identifies the resource to be represented by the Uri instance.uriKind
- Specifies whether the URI string is a relative URI, absolute URI, or is indeterminate.
Example
//from ww w . j a v a 2 s . c om
using System;
public class MainClass
{
public static void Main(String[] argv)
{
Uri myUri = new Uri("http://www.java2s.com", UriKind.Absolute);
System.Console.WriteLine(myUri);
}
}
The code above generates the following result.