Freigeben über


Uri.UriSchemeHttp Field

Microsoft Silverlight will reach end of support after October 2021. Learn more.

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

Namespace:  System
Assembly:  System (in System.dll)

Syntax

'Declaration
Public Shared ReadOnly UriSchemeHttp As String
public static readonly string UriSchemeHttp

Examples

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

Dim address3 As Uri = New Uri("https://www.contoso.com/index.htm#search")
If Uri.CheckSchemeName(address1.Scheme) Then 
  outputBlock.Text &= "address has a valid scheme name"
  outputBlock.Text &= vbCrLf
Else    
  outputBlock.Text &= "address does not have a valid scheme name"
  outputBlock.Text &= vbCrLf
End If

If address3.Scheme = Uri.UriSchemeHttp Then
  outputBlock.Text &= "Uri is HTTP type"
  outputBlock.Text &= vbCrLf
End If
Uri address3 = new Uri("https://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("https://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");
      

Version Information

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

Platforms

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

See Also

Reference