Results 1 to 2 of 2

Thread: Quickest way to determine if a Computer is on the network [VC++6]

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2003
    Posts
    308

    Question Quickest way to determine if a Computer is on the network [VC++6]

    I need to find the quickest way to determine if a computer is on the network (by machine name) - currently I use RegOpenKeyEx and if the return isn't ERROR_SUCCESS then I know I can't access the station - this takes around 8 seconds for stations that are NOT on the network.

    Now, I was doing some testing today and found some odd results where RegOpenKeyEx did return ERROR_SUCCESS for stations that I am 100% sure are not on the network and that made me start thinking that this might NOT be the best approach for trying to determine if a station is on the network or not - that and 8 seconds is kind of long if I have 20 stations to check (pretty much holds my application hostage for a worst-case-scenario time of 160 seconds).

    So I was hoping someone could propose a better, more efficient, more accurate, and quicker solution.

    In reality what I need to accomplish is:
    - Every 20 minutes check all 20 systems to see if they are on the network and retrieve the value of a specific registry key on the station
    - If they are NOT on the network log the fact and continue on to the next

    Any help would be much appreciated.
    Thanks,

  2. #2
    G&G Moderator chemicalNova's Avatar
    Join Date
    Jun 2002
    Location
    Victoria, Australia
    Posts
    4,246

    Re: Quickest way to determine if a Computer is on the network [VC++6]

    I would have a client->server setup happening.. (that tiny pun wasn't on purpose.. but yeah).

    Have a server, somewhere on your network, request a reply from each computer (stored in a list perhaps). Have a client application on each computer, which replies if it can.

    Should it reply, the server should then send out a request for the registry key, which the client will send.

    Should it not reply, that one is down.

    chem

    Visual Studio 6, Visual Studio.NET 2005, MASM

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