HttpRequest.PathInfo HttpRequest.PathInfo HttpRequest.PathInfo HttpRequest.PathInfo Property

定義

取得具有 URL 副檔名之資源的其他路徑資訊。Gets the additional path information for a resource with a URL extension.

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

屬性值

資源的其他路徑資訊。The additional path information for a resource.

範例

下列程式碼範例會判斷是否PathInfo屬性包含空字串。The following code example determines whether the PathInfo property contains an empty string. 若是如此,Write方法寫入字串,表示這個檔案。If it does, the Write method writes a string indicating this to a file. 如果沒有出現,請HtmlEncode方法將值以 HTML 編碼PathInfo屬性和WriteLine方法寫入檔案的編碼的值。If it does not, the HtmlEncode method HTML-encodes the value of the PathInfo property and the WriteLine method writes the encoded value to the file. 此程式碼範例是針對提供之較大範例的一部分HttpRequest類別。This code example is part of a larger example provided for the HttpRequest class.

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

備註

Url Http://www.contoso.com/virdir/page.html/tail,則PathInfo值是 /tail。For the URL Http://www.contoso.com/virdir/page.html/tail, the PathInfo value is /tail.

適用於

另請參閱