HttpRequest.Path Tulajdonság

Definíció

Lekéri az aktuális kérés virtuális elérési útját.

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

Tulajdonság értéke

Az aktuális kérés virtuális elérési útja.

Példák

Az alábbi példakód a metódust használja a HtmlEncode tulajdonság értékének Path HTML-kódolására, a WriteLine metódus pedig a kódolt érték fájlba írására. Ez a példakód egy nagyobb, az HttpRequest osztályhoz tartozó példa része.

// 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))

Megjegyzések

Ez Path a pótkocsi és FilePath a PathInfo pótkocsi összefűzése. Az URL-cím http://www.contoso.com/virdir/page.html/tailesetében például a Path /virdir/page.html/tail.

A következőre érvényes:

Lásd még