This topic has not yet been rated - Rate this topic

Uri.UriSchemeHttp Field

Specifies that the URI is accessed through the Hypertext Transfer Protocol (HTTP). This field is read-only.

Namespace:  System
Assembly:  System (in System.dll)
public static readonly string UriSchemeHttp

The following example creates a Uri instance and determines whether the scheme is UriSchemeHttp.


Uri address3 = new Uri("http://www.contoso.com/index.htm#search");
if (Uri.CheckSchemeName(address1.Scheme))
    outputBlock.Text += "address has a valid scheme name\n";
else    
    outputBlock.Text += "address does not has a valid scheme name\n";

if (address3.Scheme == Uri.UriSchemeHttp)
    outputBlock.Text += "Uri is HTTP type\n";
          



Uri address1 = new Uri("http://www.contoso.com/index.htm#search");
Console.WriteLine("address 1 {0} a valid scheme name",
      Uri.CheckSchemeName(address1.Scheme) ? " has" : " does not have");

if (address1.Scheme == Uri.UriSchemeHttp)
    Console.WriteLine("Uri is HTTP type");
      


Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

XNA Framework

Supported in: Xbox 360, Windows Phone OS 7.0

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ