J
John Tear
Hi
I am currently trying to get the remote IP address of a client
connection using VB.Net:
This is in my class
Private mobjSocket As Socket
' initialize with a raw socket
Public Sub New(ByVal s As Socket)
mobjSocket = s
RaiseEvent Connected(Me)
mobjSocket.BeginReceive(marData, 0, 1024, SocketFlags.None,
AddressOf DoReceive, Nothing)
End Sub
Public ReadOnly Property RemoteIPAddress() As String
Get
Dim objEPRemote As IPEndPoint
objEPRemote = CType(mobjSocket.RemoteEndPoint, IPEndPoint)
RemoteIPAddress = objEPRemote.Address.ToString()
End Get
End Property
When I try to access through a form procedure:
MessageBox.show(sender.RemoteIPAddress())
It doesnt work!!! There is other stuff in their (MSDN multi-user
server example)...
What am I doing which is so WRONG! I only want the remote IP address.
Thanks in advance, (e-mail address removed)
I am currently trying to get the remote IP address of a client
connection using VB.Net:
This is in my class
Private mobjSocket As Socket
' initialize with a raw socket
Public Sub New(ByVal s As Socket)
mobjSocket = s
RaiseEvent Connected(Me)
mobjSocket.BeginReceive(marData, 0, 1024, SocketFlags.None,
AddressOf DoReceive, Nothing)
End Sub
Public ReadOnly Property RemoteIPAddress() As String
Get
Dim objEPRemote As IPEndPoint
objEPRemote = CType(mobjSocket.RemoteEndPoint, IPEndPoint)
RemoteIPAddress = objEPRemote.Address.ToString()
End Get
End Property
When I try to access through a form procedure:
MessageBox.show(sender.RemoteIPAddress())
It doesnt work!!! There is other stuff in their (MSDN multi-user
server example)...
What am I doing which is so WRONG! I only want the remote IP address.
Thanks in advance, (e-mail address removed)