Export (0) Print
Expand All

Uri.Scheme Property

Gets the scheme name of the specified URI.

[Visual Basic]
Public ReadOnly Property Scheme As String
[C#]
public string Scheme {get;}
[C++]
public: __property String* get_Scheme();
[JScript]
public function get Scheme() : String;

Property Value

A string containing the scheme of the specified URI.

Remarks

The following table lists the valid scheme names for the Scheme property.

Scheme Description
file The resource is a file on the local computer.
ftp The resource is through FTP.
gopher The resource is accessed through the Gopher protocol.
http The resource is accessed through HTTP.
https The resource is accessed through SSL-encoded HTTP.
mailto The resource is an e-mail address and accessed through SMTP.
news The resources is accessed through NNTP.

Example

The following example writes the scheme name (http) to the console for the URI http://www.contoso.com/ .

[Visual Basic] 
Dim baseUri As New Uri("http://www.contoso.com/")
Dim myUri As New Uri(baseUri, "catalog/shownew.htm?date=today")
       
Console.WriteLine(myUri.Scheme)


[C#] 
Uri baseUri = new Uri("http://www.contoso.com/");
 Uri myUri = new Uri(baseUri, "catalog/shownew.htm?date=today");
 
 Console.WriteLine(myUri.Scheme);
   

[C++] 
Uri* baseUri = new Uri(S"http://www.contoso.com/");
Uri* myUri = new Uri(baseUri,S"catalog/shownew.htm?date=today");
 
Console::WriteLine(myUri->Scheme);

[JScript] 
var baseUri : Uri = new Uri("http://www.contoso.com/");
var myUri : Uri = new Uri(baseUri, "catalog/shownew.htm?date=today");
Console.WriteLine(myUri.Scheme);

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework, Common Language Infrastructure (CLI) Standard

See Also

Uri Class | Uri Members | System Namespace

Show:
© 2014 Microsoft