This documentation is archived and is not being maintained.

Uri.AbsolutePath Property

Gets the absolute path of the URI.

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

Property Value

A string containing the absolute path to the resource.

Remarks

The AbsolutePath property contains the path information that the server uses to resolve requests for information. Typically this is the path to the desired information on the server's file system, although it also can indicate the application or script the server must run to provide the information.

The path information does not include the scheme, host name, or query portion of the URI. The AbsolutePath property always returns at least a slash (/).

Example

The following example writes the path/catalog/shownew.htm to the console.

[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.AbsolutePath)


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

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

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

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: