C# Uri UriSchemeHttp
Description
Uri UriSchemeHttp
specifies that the URI is accessed
through the Hypertext Transfer Protocol (HTTP). This field is read-only.
Syntax
Uri.UriSchemeHttp
has the following syntax.
public static readonly string UriSchemeHttp
Example
The following example creates a Uri instance and determines whether the scheme is UriSchemeHttp.
//from w w w .j a v a 2 s .co m
using System;
public class MainClass{
public static void Main(String[] argv){
Uri address1 = new Uri("http://www.java2s.com/index.htm#search");
Console.WriteLine(Uri.CheckSchemeName(address1.Scheme));
if (address1.Scheme == Uri.UriSchemeHttp)
Console.WriteLine("Uri is HTTP type");
Console.WriteLine(address1.HostNameType);
}
}
The code above generates the following result.