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.





















Home »
  C# Tutorial »
    System »




Array
BitConverter
Boolean
Byte
Char
Console
ConsoleKeyInfo
Convert
DateTime
DateTimeOffset
Decimal
Double
Enum
Environment
Exception
Guid
Int16
Int32
Int64
Math
OperatingSystem
Random
SByte
Single
String
StringComparer
TimeSpan
TimeZone
TimeZoneInfo
Tuple
Tuple
Tuple
Type
UInt16
UInt32
UInt64
Uri
Version