IPAddress

D

developer1996

I need to get the IPAddress of the user who is using my
service does any on have any ideas on how this could be
accomplish with a webservice?
 
D

developer1996

-----Original Message-----
I need to get the IPAddress of the user who is using my
service does any on have any ideas on how this could be
accomplish with a webservice?
.

I figured it out. It was a dumb question to start with.
this.Context.Request.UserHostAddress
 
R

rimfire

This works for me on a web service, give it a try, on client and then you can return the IP to the WS?

regards

Graeme

Imports System.Net
Private Function ReturnServerIP() As String
Dim sHostName As String
Dim i As Integer
sHostName = Dns.GetHostName()
Dim ipE As IPHostEntry = Dns.GetHostByName(sHostName)
Dim IpA() As IPAddress = ipE.AddressList
ReturnServerIP = IpA(0).ToString
End Function

**********************************************************************
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...
 

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

Members online

Forum statistics

Threads
474,431
Messages
2,571,677
Members
48,796
Latest member
Greg L.

Latest Threads

Top