HttpRequest.Path Proprietà

Definizione

Ottiene il percorso virtuale della richiesta corrente.

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

Valore della proprietà

Percorso virtuale della richiesta corrente.

Esempio

Nell'esempio di codice seguente viene usato il metodo per codificare HTML il HtmlEncode valore della Path proprietà e il WriteLine metodo per scrivere il valore codificato nel file. Questo esempio di codice fa parte di un esempio più grande fornito per la HttpRequest classe.

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

Commenti

È Path la concatenazione del FilePath trailer e.PathInfo Ad esempio, per l'URL http://www.contoso.com/virdir/page.html/tail, il Path è /virdir/page.html/tail.

Si applica a

Vedi anche