HttpRequest.Path Vlastnost

Definice

Získá virtuální cestu aktuálního požadavku.

public:
 property System::String ^ Path { System::String ^ get(); };
public string Path { get; }
member this.Path : string
Public ReadOnly Property Path As String

Hodnota vlastnosti

Virtuální cesta aktuálního požadavku.

Příklady

Následující příklad kódu používá metodu HtmlEncode html kódovat hodnotu Path vlastnosti a metodu WriteLine k zápisu zakódované hodnoty do souboru. Tento příklad kódu je součástí většího příkladu HttpRequest pro třídu .

// Write request information to the file with HTML encoding.
sw.WriteLine(Server.HtmlEncode(DateTime.Now.ToString()));
sw.WriteLine(Server.HtmlEncode(Request.CurrentExecutionFilePath));
sw.WriteLine(Server.HtmlEncode(Request.ApplicationPath));
sw.WriteLine(Server.HtmlEncode(Request.FilePath));
sw.WriteLine(Server.HtmlEncode(Request.Path));
' Write request information to the file with HTML encoding.
sw.WriteLine(Server.HtmlEncode(DateTime.Now.ToString()))
sw.WriteLine(Server.HtmlEncode(Request.CurrentExecutionFilePath))
sw.WriteLine(Server.HtmlEncode(Request.ApplicationPath))
sw.WriteLine(Server.HtmlEncode(Request.FilePath))
sw.WriteLine(Server.HtmlEncode(Request.Path))

Poznámky

Je Path zřetězení FilePath a přívěsu PathInfo . Například pro adresu URL http://www.contoso.com/virdir/page.html/tailPath je /virdir/page.html/tail.

Platí pro

Viz také