Partager via


HttpRequest.PathInfo Propriété

Définition

Obtient les informations de chemin d’accès supplémentaires pour une ressource avec une extension d’URL.

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

Valeur de propriété

Informations supplémentaires sur le chemin d’accès d’une ressource.

Exemples

L’exemple de code suivant détermine si la PathInfo propriété contient une chaîne vide. Si c’est le cas, la Write méthode écrit une chaîne indiquant ceci dans un fichier. Si ce n’est pas le cas, la HtmlEncode méthode HTML code la valeur de la PathInfo propriété et la WriteLine méthode écrit la valeur encodée dans le fichier. Cet exemple de code fait partie d’un exemple plus grand fourni pour 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

Remarques

Pour l’URL http://www.contoso.com/virdir/page.html/tail, la PathInfo valeur est /tail.

S’applique à

Voir aussi