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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top