IP address of request.

  • Thread starter Thread starter Shimon Sim
  • Start date Start date
S

Shimon Sim

How to find out IP address of request?

If I sent request via HttpWebRequest can I set IP or it is added
automatically?
Thanks,
Shimon.
 
Shimon Sim said:
How to find out IP address of request?

Read the UserHostAddress property off of the HttpRequest your
web application receives, i.e.,

public void Page_Load( object sender, System.EventArgs args)
{
// . . .
this.Label1.Text = Page.Request.UserHostAddress;
// . . .
}
If I sent request via HttpWebRequest can I set IP or it is added automatically?

Wouldn't be very reliable if the sender could set it, now would it?

An IP address for the request's originator would get added auto-
matically onto the packet further down in the networking stack
(think in terms of the 7-layer OSI model).


Derek Harmon
 
Thanks.
I didn't think that I could set it. But when thing just doesn't want to work
you come up with all sorts of ideas.
Thanks,
Shimon.
 
Back
Top