Export (0) Print
Expand All

HttpRequest.PhysicalApplicationPath Property

Gets the physical file system path of the currently executing server application's root directory.

Namespace: System.Web
Assembly: System.Web (in system.web.dll)

'Declaration
Public ReadOnly Property PhysicalApplicationPath As String
'Usage
Dim instance As HttpRequest
Dim value As String

value = instance.PhysicalApplicationPath

/** @property */
public String get_PhysicalApplicationPath ()

public function get PhysicalApplicationPath () : String

Not applicable.

Property Value

The file system path of the current application's root directory.

The following code example uses the HtmlEncode method to HTML-encode the value of the PhysicalApplicationPath property and the WriteLine method to write the encoded value to the file. This code example is part of a larger example provided for the HttpRequest class.

' Write request information to the file with HTML encoding.
sw.WriteLine(Server.HtmlEncode(Request.PhysicalApplicationPath))
sw.WriteLine(Server.HtmlEncode(Request.PhysicalPath))
sw.WriteLine(Server.HtmlEncode(Request.RawUrl))

Windows 98, Windows Server 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0

Community Additions

ADD
Show:
© 2014 Microsoft