Results 1 to 8 of 8

Thread: [Resolved] Detecting Computers On Lan

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Feb 2008
    Location
    XP & Vista
    Posts
    181

    Resolved [Resolved] Detecting Computers On Lan

    I have made a chat program to work over my local network, the thing is the only way it works is if you have the computers IP address or by using the built in IP scanner (WHICH CAN TAKE AGES).

    I was wondering if there was a way to find all the IP addresses on the network so it can quickly go through them and see which people are running my chat client and so we can chat till our hearts content.

    If any dos command available please post......

    Advance thanks
    Last edited by kpmsivachand; Dec 21st, 2008 at 02:51 PM.

  2. #2
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,127

    Re: Detecting Computers On Lan

    Which programming language do you need it? Have you tried searching here or googling for it?
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  3. #3
    PowerPoster
    Join Date
    Jul 2006
    Location
    Maldon, Essex. UK
    Posts
    6,334

    Re: Detecting Computers On Lan

    If this is running over a LAN why not use the Computer name(s) rather than IP Addresses?

  4. #4
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,127

    Re: Detecting Computers On Lan

    This is for VB6.0, and this is for C#, take your pick.
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Feb 2008
    Location
    XP & Vista
    Posts
    181

    Re: Detecting Computers On Lan

    Quote Originally Posted by dee-u
    Which programming language do you need it? Have you tried searching here or googling for it?
    I am sorry for didnt mention the language.... I need vb only.... Thanks for your links.... Try it now...

  6. #6
    Powered By Medtronic dbasnett's Avatar
    Join Date
    Dec 2007
    Location
    Jefferson City, MO
    Posts
    9,897

    Re: Detecting Computers On Lan

    see my signature for the IP / Subnet Range link. one of the parts generates a list of IP's.

    once you have the list you can ping them and see if they respond.

    i'd do it in a backgroundworker so as not to make your app appear slow, and set the timeout to a low value if the computers are on the same network.

    Code:
            Dim ipLIST As List(Of String) = ipRange("192.168.1.1", "255.255.255.0") 'get list
            Dim ipFND As New List(Of String)
    
    'in a backgroundworker
            For idx = 0 To ipLIST.Count - 1
                If My.Computer.Network.Ping(ipLIST.Item(idx), 1) Then
                    'found one
                    ipFND.Add(ipLIST.Item(idx))
                End If
            Next
    Last edited by dbasnett; Dec 21st, 2008 at 12:25 PM.
    My First Computer -- Documentation Link (RT?M) -- Using the Debugger -- Prime Number Sieve
    Counting Bits -- Subnet Calculator -- UI Guidelines -- >> SerialPort Answer <<

    "Those who use Application.DoEvents have no idea what it does and those who know what it does never use it." John Wein

  7. #7

    Thread Starter
    Addicted Member
    Join Date
    Feb 2008
    Location
    XP & Vista
    Posts
    181

    Re: Detecting Computers On Lan

    [QUOTE=dbasnett]see my signature for the IP / Subnet Range link. one of the parts generates a list of IP's.

    once you have the list you can ping them and see if they respond.

    i'd do it in a backgroundworker so as not to make your app appear slow, and set the timeout to a low value if the computers are on the same network.

    Thanks for your reply..... Buddy I need vb code for finding out... But your IP / Subnet Range link is vb.net...

  8. #8

    Thread Starter
    Addicted Member
    Join Date
    Feb 2008
    Location
    XP & Vista
    Posts
    181

    Resolved Re: Detecting Computers On Lan

    Quote Originally Posted by dee-u
    This is for VB6.0, and this is for C#, take your pick.
    That C# code works perfectly.... Thanks dee-u

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width