This documentation is archived and is not being maintained.

Uri.Scheme Property

Gets the scheme name of the specified URI.

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

Property Value

A string containing the scheme of the specified URI.


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.


The following example writes the scheme name (http) to the console for the URI .

[Visual Basic] 
Dim baseUri As New Uri("")
Dim myUri As New Uri(baseUri, "catalog/shownew.htm?date=today")

Uri baseUri = new Uri("");
 Uri myUri = new Uri(baseUri, "catalog/shownew.htm?date=today");

Uri* baseUri = new Uri(S"");
Uri* myUri = new Uri(baseUri,S"catalog/shownew.htm?date=today");

var baseUri : Uri = new Uri("");
var myUri : Uri = new Uri(baseUri, "catalog/shownew.htm?date=today");


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