.net - To get visitors IP address -


I would like to get the visitor's IP address.

Which is appropriate to use:

  request. The server ("REMOTE_ADDR")   

or

  request. UserHostress   

Which is the best way?

They are exactly the same UserHostAddress just call GetRemoteAddress .

  public string UserHostAddress {get {if (this._wr! = Null) {this._wr return GetRemoteAddress (); } Return tap; }} Public override string GetRemoteAddress () {return it back. GETServerVariable ("REMOTE_ADDR"); }   

Both also. Net Framework 1.0 / 1.1 are ahead

Comments

Popular posts from this blog

java - NullPointerException for a 2d Array -

python - Assemble mpeg file unable to play in mediaplayer -

asp.net - MVC [HandleError] HandleErrorAttribute called twice when using global logging -