Condividi tramite


HttpRequest.PathInfo Proprietà

Definizione

Ottiene le informazioni aggiuntive sul percorso per una risorsa con un'estensione URL.

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

Valore della proprietà

Informazioni aggiuntive sul percorso per una risorsa.

Esempio

Nell'esempio di codice seguente viene determinato se la PathInfo proprietà contiene una stringa vuota. In caso affermativo, il Write metodo scrive una stringa che indica tale valore in un file. In caso contrario, il HtmlEncode metodo HTML codifica il valore della PathInfo proprietà e il WriteLine metodo scrive il valore codificato nel file. Questo esempio di codice fa parte di un esempio più ampio fornito per la HttpRequest classe .

// Write the PathInfo property value
// or a string if it is empty.
if (Request.PathInfo == String.Empty)
{
    sw.WriteLine("The PathInfo property contains no information.");
}
else
{
    sw.WriteLine(Server.HtmlEncode(Request.PathInfo));
}
' Write the PathInfo property value
' or a string if it is empty.
If Request.PathInfo = String.Empty Then
    sw.WriteLine("The PathInfo property contains no information.")
Else
    sw.WriteLine(Server.HtmlEncode(Request.PathInfo))
End If

Commenti

Per l'URL http://www.contoso.com/virdir/page.html/tail, il PathInfo valore è /tail.

Si applica a

Vedi anche