HttpRequest.PathInfo プロパティ

URL 拡張子付きリソースの追加パス情報を取得します。

名前空間: System.Web
アセンブリ: System.Web (system.web.dll 内)

構文

'宣言
Public ReadOnly Property PathInfo As String
'使用
Dim instance As HttpRequest
Dim value As String

value = instance.PathInfo
public string PathInfo { get; }
public:
property String^ PathInfo {
    String^ get ();
}
/** @property */
public String get_PathInfo ()
public function get PathInfo () : String
適用できません。

プロパティ値

リソースの追加パス情報。

解説

URL が Http://www.contoso.com/virdir/page.html/tail の場合は、PathInfo 値が /tail になります。

使用例

PathInfo プロパティに空の文字列が格納されているかどうかを確認するコード例を次に示します。空の文字列が格納されている場合は、Write メソッドによって、これを示す文字列がファイルに書き込まれます。空の文字列ではない場合は、HtmlEncode メソッドによって PathInfo プロパティの値が HTML エンコードされ、エンコードされた値が WriteLine メソッドによってファイルに書き込まれます。このコード例は、HttpRequest クラスのトピックで取り上げているコード例の一部分です。

' 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
// 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));
}

プラットフォーム

Windows 98,Windows Server 2000 SP4,Windows CE,Windows Millennium Edition,Windows Mobile for Pocket PC,Windows Mobile for Smartphone,Windows Server 2003,Windows XP Media Center Edition,Windows XP Professional x64 Edition,Windows XP SP2,Windows XP Starter Edition

Microsoft .NET Framework 3.0 は Windows Vista,Microsoft Windows XP SP2,および Windows Server 2003 SP1 でサポートされています。

バージョン情報

.NET Framework

サポート対象 : 3.0,2.0,1.1,1.0

参照

関連項目

HttpRequest クラス
HttpRequest メンバ
System.Web 名前空間
HttpRequest.Path プロパティ
HttpRequest.FilePath プロパティ