.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