Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. IP Address Problem

IP Address Problem

Scheduled Pinned Locked Moved C#
questionhelp
5 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    dipak dipak
    wrote on last edited by
    #1

    Hello, How can i get IP addess of the computers connected with LAN? Thank you :-O

    Dipak

    H 1 Reply Last reply
    0
    • D dipak dipak

      Hello, How can i get IP addess of the computers connected with LAN? Thank you :-O

      Dipak

      H Offline
      H Offline
      half life
      wrote on last edited by
      #2

      and u're acting as a Client/Server have u tried tcpcliecnt? more inforamatio will help us to help u :)

      Where there is a will there is a way (yeh, right, hahaha)

      D 1 Reply Last reply
      0
      • H half life

        and u're acting as a Client/Server have u tried tcpcliecnt? more inforamatio will help us to help u :)

        Where there is a will there is a way (yeh, right, hahaha)

        D Offline
        D Offline
        dipak dipak
        wrote on last edited by
        #3

        Thank you for Reply Yes i am as a client of that LAN. And i want to get all the IP Addresses and Names of the computers connected with the same LAN. I have tried this way for test: using System.Net; String strHostName = Dns.GetHostName(); MessageBox.Show(strHostName.ToString()); IPHostEntry ipEntry = Dns.GetHostByName(strHostName); IPAddress[] addr = ipEntry.AddressList; for (int i = 0; i < addr.Length; i++) { MessageBox.Show(addr[i].ToString()); } But it gets only My Computer's IP Address and another one IP address. I think it is mac address. I have put that IP Address on Run "\\121.245.75.159" but i opens my ShareDocs. Please help me. :-O

        Dipak

        S D 2 Replies Last reply
        0
        • D dipak dipak

          Thank you for Reply Yes i am as a client of that LAN. And i want to get all the IP Addresses and Names of the computers connected with the same LAN. I have tried this way for test: using System.Net; String strHostName = Dns.GetHostName(); MessageBox.Show(strHostName.ToString()); IPHostEntry ipEntry = Dns.GetHostByName(strHostName); IPAddress[] addr = ipEntry.AddressList; for (int i = 0; i < addr.Length; i++) { MessageBox.Show(addr[i].ToString()); } But it gets only My Computer's IP Address and another one IP address. I think it is mac address. I have put that IP Address on Run "\\121.245.75.159" but i opens my ShareDocs. Please help me. :-O

          Dipak

          S Offline
          S Offline
          Skippums
          wrote on last edited by
          #4

          Just an idea, but what if you get your own ip address (using the method you described), your own subnet mask[^], and then ping all the possible addresses within that subnet? The link (labeled "subnet mask" will also allow you to ping the other addresses as well). This will work assuming your subnet mask limits the number of possible ip's to a reasonable number (probably less than 2^8 is reasonable.) Hopefully someone else will offer a more efficient way to do this for you, but in the meantime this will work.

          Sounds like somebody's got a case of the Mondays -Jeff

          1 Reply Last reply
          0
          • D dipak dipak

            Thank you for Reply Yes i am as a client of that LAN. And i want to get all the IP Addresses and Names of the computers connected with the same LAN. I have tried this way for test: using System.Net; String strHostName = Dns.GetHostName(); MessageBox.Show(strHostName.ToString()); IPHostEntry ipEntry = Dns.GetHostByName(strHostName); IPAddress[] addr = ipEntry.AddressList; for (int i = 0; i < addr.Length; i++) { MessageBox.Show(addr[i].ToString()); } But it gets only My Computer's IP Address and another one IP address. I think it is mac address. I have put that IP Address on Run "\\121.245.75.159" but i opens my ShareDocs. Please help me. :-O

            Dipak

            D Offline
            D Offline
            Dave Kreskowiak
            wrote on last edited by
            #5

            You'll have to go through the entire range of IP addresses, PING each one to see if it responds, and if so, resolve that IP to its host name. There is no one function that you can call to give you the entire list.

            A guide to posting questions on CodeProject[^]
            Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                 2006, 2007

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups