HttpRequest.Path-Eigenschaft
Ruft den virtuellen Pfad der aktuellen Anforderung ab.
Namespace: System.Web
Assembly: System.Web (in system.web.dll)
Syntax
'Declaration
Public ReadOnly Property Path As String
'Usage
Dim instance As HttpRequest
Dim value As String
value = instance.Path
public string Path { get; }
public:
property String^ Path {
String^ get ();
}
/** @property */
public String get_Path ()
public function get Path () : String
Eigenschaftenwert
Der virtuelle Pfad der aktuellen Anforderung.
Hinweise
Der Path enthält den PathInfo-Nachspann. Für den URL https://www.contoso.com/virdir/page.html/tail lautet der Path z. B. https://www.contoso.com/virdir/page.html/tail.
Beispiel
Im folgenden Codebeispiel wird die HtmlEncode-Methode für das Codieren des Werts der Path-Eigenschaft im HTML-Format verwendet und die WriteLine-Methode für das Schreiben des codierten Werts in die Datei. Dieses Codebeispiel ist Teil eines umfangreicheren Beispiels für die HttpRequest-Klasse.
' 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));
Plattformen
Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
.NET Framework unterstützt nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen.
Versionsinformationen
.NET Framework
Unterstützt in: 2.0, 1.1, 1.0