Results 1 to 6 of 6

Thread: code for getting the system names in a lan

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2004
    Posts
    3

    code for getting the system names in a lan

    I want VB.NET code for getting the systems names and ip addresses in a lan

  2. #2
    Hyperactive Member nagasrikanth's Avatar
    Join Date
    Nov 2004
    Location
    India,Hyderabad.
    Posts
    420

    Re: code for getting the system names in a lan

    Hi guys...

    Now I too have the same problem...Is there any solution for this ???
    The Difference between a Successful person and others is not a Lack of Knowledge,
    But rather a Lack of WILL

  3. #3
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: code for getting the system names in a lan

    (Import System.NET first)

    Dim strHost As String
    strHost = Dns.GetHostName()

    Dim iphe AS IPHostEntry
    iphe = Dns.GetHostByName(strHost)

  4. #4
    PowerPoster JuggaloBrotha's Avatar
    Join Date
    Sep 2005
    Location
    Lansing, MI; USA
    Posts
    4,286

    Re: code for getting the system names in a lan

    mendhak's code only gets the ip address and hostname of the machine that the code is running on
    Currently using VS 2015 Enterprise on Win10 Enterprise x64.

    CodeBank: All ThreadsColors ComboBoxFading & Gradient FormMoveItemListBox/MoveItemListViewMultilineListBoxMenuButtonToolStripCheckBoxStart with Windows

  5. #5
    PowerPoster sparrow1's Avatar
    Join Date
    May 2005
    Location
    Globetrotter
    Posts
    2,820

    Re: code for getting the system names in a lan

    Hi,

    Use the System.Net.DNS class, which provides de shared GetHostName and GetHostByName methods.

    Try this;

    VB Code:
    1. Dim HostName As String
    2. Dim IPAddress As String
    3.  
    4. ' Look up the host name and Ip address
    5.  
    6. HostName = System.Net.Dns.GetHostName()
    7. IPAddress = System.Net.Dns.GetHostByName(HostName).AddressList(0).ToString()
    8.  
    9. Console.WriteLine("Host name:" & HostName)
    10. Console.WriteLine("IP address:" & IPAddress)

    Hope it helps,

    sparrow1
    Wkr,
    sparrow1

    If I helped you, don't forget to Rate my post. Thank you

    I'm using Visual Studio.Net 2003 and
    2005
    How to learn VB.Net Create setup with VB 2005 Drawing for beginners VB.Net Tutorials GDI+ Tutorials
    Video's for beginners

  6. #6
    Hyperactive Member nagasrikanth's Avatar
    Join Date
    Nov 2004
    Location
    India,Hyderabad.
    Posts
    420

    Re: code for getting the system names in a lan

    Hi...

    Thats really great job done by u..


    but as JuggaloBrotha said,both this will give the IP and system name of the mechine on which the application is running,But as a Administrator I would like to monitor all the systems from my PC..Is it possible???
    The Difference between a Successful person and others is not a Lack of Knowledge,
    But rather a Lack of WILL

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