HttpRequest.PathInfo Propriété

Définition

Obtient des informations supplémentaires sur le chemin d’accès d’une ressource avec extension 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é

String

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 cela dans un fichier. Si ce n’est pas le cas, la HtmlEncode méthode HTML encode 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