System.Uri.AbsolutePath Property

Gets the absolute path of the URI.

Syntax

public string AbsolutePath { get; }

Value

A string containing the absolute path to the resource.

Remarks

The Uri.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.

Example

The following example outputs the absolute path of a URI.

C# Example

using System;

public class UriTest {
 public static void Main() {
   Uri myUri = new Uri ("http://www.contoso.com/URI/Hello%20World.htm?date=today", true);
   Console.WriteLine(myUri.AbsolutePath);
 }
}
   

The output is

/URI/Hello%20World.htm

Requirements

Namespace: System
Assembly: System (in System.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0