Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5839847
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T11:38:57+00:00 2026-05-22T11:38:57+00:00

How I can retrieve the IP address for a client when this client is

  • 0

How I can retrieve the IP address for a client when this client is connected to the server through Lan network and show it as a string in textbox?
The server code:

    Imports System.Net.Sockets

Imports System.Threading
Imports System.Windows.Forms
Imports System.IO

Public Class broadcast


Private thread As Thread
Private listener As New TcpListener(5234)
Private writers As New ArrayList
Private name As String



Public Sub New(ByVal name As String)
    MyBase.New()
    Me.name = name

End Sub

Public Sub start()
    listener.Start()
    thread = New Thread(AddressOf RunServer)
    thread.Start()
End Sub


Public Sub RunServer()
    Try
        While True
            Dim writer As New BinaryWriter(New NetworkStream(listener.AcceptSocket))
            writer.Write(name)

            writers.Add(writer)

        End While

    Catch exception As Exception
        'MessageBox.Show("Server application Closing")

    End Try
End Sub


Public Sub sendCommand(ByVal command As String)
    For i As Integer = 0 To writers.Count
        Try
            Dim writer As BinaryWriter
            writer = CType(writers.Item(i), BinaryWriter)
            writer.Write(command)
            writer.Flush()
        Catch inputputputexception As Exception
        End Try
    Next
End Sub

Public Sub stopAll()
    For i As Integer = 0 To writers.Count
        Try

            Dim writer As BinaryWriter
            writer = CType(writers.Item(0), BinaryWriter)
            writer.Close()
            writers.Remove(0)
        Catch inputputputexception As Exception
        End Try
    Next
    listener.Stop()



End Sub

End Class

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T11:38:58+00:00Added an answer on May 22, 2026 at 11:38 am

    The IP address of the other party is available from the Socket from its RemoteEndPoint property (if it is connected).

    Use Serialize to convert to a SocketAddress which overrides ToString() to get the address in a readable format.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any way i can retrieve MAC Address when Network Adapter is disabled
How can I retrieve the address and zip code of one or more customers
I need to retrieve contacts from Exchange server global address book using this SOAP
How can I retrieve the links of a webpage and copy the url address
How can I retrieve the current working directory of cmd.exe? This seems possible. For
I have country and address. How can I retrieve latitude and longitude from Google
How can I retrieve the country code information for Android devices under CDMA networks?
From an ASP.NET page I'm able to retrieve the client's IP address (at least
I can retrieve the text of a web page, let's say https://stackoverflow.com/questions with some
I know I can retrieve some settings.xml parameters using properties, like, for example ${settings.localRepository}

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.