HttpRequest.PathInfo Właściwość

Definicja

Pobiera dodatkowe informacje o ścieżce dla zasobu z rozszerzeniem adresu URL.

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

Wartość właściwości

Dodatkowe informacje o ścieżce zasobu.

Przykłady

Poniższy przykład kodu określa, czy PathInfo właściwość zawiera pusty ciąg. Jeśli tak, Write metoda zapisuje ciąg wskazujący to na plik. Jeśli tak nie jest, HtmlEncode metoda HTML koduje wartość PathInfo właściwości, a WriteLine metoda zapisuje zakodowaną wartość w pliku. Ten przykład kodu jest częścią większego przykładu udostępnionego HttpRequest dla klasy .

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

Uwagi

W przypadku adresu URL http://www.contoso.com/virdir/page.html/tailPathInfo wartość to /tail.

Dotyczy

Zobacz też