HttpRequest.FilePath Свойство

Определение

Получает виртуальный путь текущего запроса.

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

Значение свойства

Виртуальный путь текущего запроса.

Примеры

В следующем примере кода используется HtmlEncode метод для html-кодирования значения FilePath свойства и 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))

Комментарии

Свойство FilePath не включает PathInfo трейлер. Например, для URL-адреса http://www.contoso.com/virdir/page.html/tailFilePath значение равно /virdir/page.html.

Применяется к

См. также раздел