HttpRequest.CurrentExecutionFilePath プロパティ

定義

現在の要求の仮想パスを取得します。

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

プロパティ値

現在の要求の仮想パス。

次のコード例では、 メソッドを HtmlEncode 使用して プロパティの値を CurrentExecutionFilePath HTML エンコードし、 メソッドを WriteLine 使用してエンコードされた値をファイルに書き込みます。 このコード例は、HttpRequest クラスのために提供されている大規模な例の一部です。

// Write request information to the file with HTML encoding.
sw.WriteLine(Server.HtmlEncode(DateTime.Now.ToString()));
sw.WriteLine(Server.HtmlEncode(Request.CurrentExecutionFilePath));
sw.WriteLine(Server.HtmlEncode(Request.ApplicationPath));
sw.WriteLine(Server.HtmlEncode(Request.FilePath));
sw.WriteLine(Server.HtmlEncode(Request.Path));
' Write request information to the file with HTML encoding.
sw.WriteLine(Server.HtmlEncode(DateTime.Now.ToString()))
sw.WriteLine(Server.HtmlEncode(Request.CurrentExecutionFilePath))
sw.WriteLine(Server.HtmlEncode(Request.ApplicationPath))
sw.WriteLine(Server.HtmlEncode(Request.FilePath))
sw.WriteLine(Server.HtmlEncode(Request.Path))

注釈

CurrentExecutionFilePath は、現在実行中のページ ハンドラーへのファイル パスを返します。 および Transfer メソッドを使用Executeするリダイレクト シナリオの場合、これは、 プロパティが リダイレクト先のページ (子ページ) へのパスを返しますCurrentExecutionFilePath。 ただし、クライアントが別のページにリダイレクトされると、 プロパティは FilePath 元のページへのパスを返します。

適用対象

こちらもご覧ください