HttpRequest.FilePath-Eigenschaft
Ruft den virtuellen Pfad der aktuellen Anforderung ab.
Namespace: System.Web
Assembly: System.Web (in system.web.dll)
Syntax
'Declaration
Public ReadOnly Property FilePath As String
'Usage
Dim instance As HttpRequest
Dim value As String
value = instance.FilePath
public string FilePath { get; }
public:
property String^ FilePath {
String^ get ();
}
/** @property */
public String get_FilePath ()
public function get FilePath () : String
Eigenschaftenwert
Der virtuelle Pfad der aktuellen Anforderung.
Hinweise
Die FilePath-Eigenschaft enthält nicht den PathInfo-Nachspann. Für den URL https://www.contoso.com/virdir/page.html/tail lautet der FilePath-Wert z. B. /virdir/page.html.
Beispiel
Im folgenden Codebeispiel wird die HtmlEncode-Methode für das Codieren des Werts der FilePath-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