Argument for Constructor to Return Client IP Address with

I found many questions on how to get the client IP with The questions pointed to this Article.  "" I need help figuring out what to send for "client" in the constructor. Thanks  John
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Fernando SotoRetiredCommented:
Hi just_joe_;

Client is a instantiated object of type TcpClient. So in the constructor of the ClientConnection pass in the TcpClient of the object you want the remote IP address of.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
just_joe_Author Commented:
Thank you
Fernando SotoRetiredCommented:
Not a problem, glad to help. ;=)
just_joe_Author Commented:
Located an answer for anyone who needs it.

Code Below
Imports System.Net
Public Class Form1
  Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Dim addrs() As IPAddress = Dns.GetHostAddresses(Dns.GetHostName)
    If addrs.Length > 0 Then Label1.Text = addrs(0).ToString()
  End Sub
End Class

Open in new window

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.