client IP address in a web service

  • Thread starter Thread starter tim djossou
  • Start date Start date
T

tim djossou

Hi

Is there a way to get the IP address of the client who is using a web
service (inside the web service?)

Regards
 
Tim,

Yous hould be able to get this using the UserHostAddress property on the
HttpRequest class. You can get this in a web service using the following:

// Get the context.
string pstrClientAddress = HttpContext.Current.Request.UserHostAddress;

Hope this helps.
 

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