Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
UserHostAddress Property

HttpRequest.UserHostAddress Property

Gets the IP host address of the remote client.

[Visual Basic]
Public ReadOnly Property UserHostAddress As String
public string UserHostAddress {get;}
public: __property String* get_UserHostAddress();
public function get UserHostAddress() : String;

Property Value

The IP address of the remote client.


The following example assigns the IP address of the remote client to a string variable.

[Visual Basic] 
Dim ClientIP As String
 ClientIP = Request.UserHostAddress

String ClientIP;
 ClientIP = Request.UserHostAddress;

String* ClientIP;
 ClientIP = Request->UserHostAddress;

var clientIP : String = Request.UserHostAddress


Platforms: Windows 2000, Windows XP Professional, Windows Server 2003 family

See Also

HttpRequest Class | HttpRequest Members | System.Web Namespace

© 2015 Microsoft