Bagikan melalui


HttpRequest.PathInfo Properti

Definisi

Mendapatkan informasi jalur tambahan untuk sumber daya dengan ekstensi URL.

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

Nilai Properti

Informasi jalur tambahan untuk sumber daya.

Contoh

Contoh kode berikut menentukan apakah PathInfo properti berisi string kosong. Jika ya, Write metode menulis string yang menunjukkan ini ke file. Jika tidak, HtmlEncode metode HTML mengodekan nilai PathInfo properti dan WriteLine metode menulis nilai yang dikodekan ke file. Contoh kode ini adalah bagian dari contoh yang lebih besar yang disediakan untuk HttpRequest kelas .

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

Keterangan

Untuk URL http://www.contoso.com/virdir/page.html/tail, nilainya PathInfo adalah /tail.

Berlaku untuk

Lihat juga