Results 1 to 7 of 7

Thread: I need help on using API to get LAN IP adresses

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2008
    Posts
    4

    Red face I need help on using API to get LAN IP adresses

    Hi all, can you use API to get the IP addresses of other computers on a LAN network? I'll like to know the code.

    Can you also assist me with a code that will indicate if a computer is connected to a network via LAN cable?

    THANKS!!!

  2. #2
    Pro Grammar chris128's Avatar
    Join Date
    Jun 2007
    Location
    England
    Posts
    7,604

    Re: I need help on using API to get LAN IP adresses

    in response to your first question - Do you mean get the IP of every machine on the network or do you mean get the IP of specific PCs?

    in response to your second question - do you mean you just want to check if the machine is actually connected to the network or do you mean you want to know if they are connected via ethernet cable or wireless?

    Also, what research and code have you got so far?
    My free .NET Windows API library (Version 2.2 Released 12/06/2011)

    Blog: cjwdev.wordpress.com
    Web: www.cjwdev.co.uk


  3. #3

    Thread Starter
    New Member
    Join Date
    Aug 2008
    Posts
    4

    Re: I need help on using API to get LAN IP adresses

    Hi Chris, I mean a code that will get the IP address of every machine on the network.

    Secondly, a code that will check if the machine is actually connected to a network via LAN only.

    I'm kinda new in the VB6 game. I did some research and found out something about APIs. Haven't yet got a working code.

    Can u help?

  4. #4
    PowerPoster Fazi's Avatar
    Join Date
    Aug 2005
    Location
    Underworld
    Posts
    2,525

    Re: I need help on using API to get LAN IP adresses

    You have another option,
    You can cmd the command and catch the out put in to a text file.

    CMD> NET view > C:\computers.txt

    You need to excute this form your vb app.

    *net view or some command, i forget

    Edited : arp -a is the command it look like. i dont have a network here to check.
    Last edited by Fazi; Aug 23rd, 2008 at 05:11 AM.

  5. #5
    Pro Grammar chris128's Avatar
    Join Date
    Jun 2007
    Location
    England
    Posts
    7,604

    Re: I need help on using API to get LAN IP adresses

    Quote Originally Posted by Souldx7
    Hi Chris, I mean a code that will get the IP address of every machine on the network.

    Secondly, a code that will check if the machine is actually connected to a network via LAN only.

    I'm kinda new in the VB6 game. I did some research and found out something about APIs. Haven't yet got a working code.

    Can u help?
    Ah sorry I didnt realise you were using VB6. One question though, if you are new to VB6, why not just start with VB.NET? The only reason anyone uses VB6 now is because they have spent years using it... or they have to support a system that was already written in VB6. If your not in either of those situations then I would recommend learning VB.NET instead.
    My free .NET Windows API library (Version 2.2 Released 12/06/2011)

    Blog: cjwdev.wordpress.com
    Web: www.cjwdev.co.uk


  6. #6

    Thread Starter
    New Member
    Join Date
    Aug 2008
    Posts
    4

    Re: I need help on using API to get LAN IP adresses

    Thanks, but I'm not that new to vb6. I've already gone as far as studying API but I have NO idea how to call them or code them.


    About using cmd, how do i link it from VB, my expertise ain't that great. I just know the basics.

  7. #7
    PowerPoster Fazi's Avatar
    Join Date
    Aug 2005
    Location
    Underworld
    Posts
    2,525

    Re: I need help on using API to get LAN IP adresses

    yah, you just output the cmd to a text file and read form it.

    ie.
    Code:
    Private Sub Command1_Click()
    Call Shell(Environ("COMSPEC") & " /c ipconfig > c:\output.txt", vbHide)
    End Sub
    check this thread for all CMD Shellings.
    http://www.vbforums.com/archive/index.php/t-364219.html

    BTW, To list all ip's in a network in command problem, i am still forget the comaand. so pls post a question in our general computer section.

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