Export (0) Print
Expand All

HttpRequest.UserHostName Property

Gets the DNS name of the remote client.

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

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

value = instance.UserHostName

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

public function get UserHostName () : String

Not applicable.

Property Value

The DNS name of the remote client.

The following code example uses the HtmlEncode method to HTML-encode the value of the UserHostName 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.RequestType))
sw.WriteLine(Server.HtmlEncode(Request.UserHostAddress))
sw.WriteLine(Server.HtmlEncode(Request.UserHostName))
sw.WriteLine(Server.HtmlEncode(Request.HttpMethod))

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