How can I enumerate logged in machine names ?
Printable View
How can I enumerate logged in machine names ?
Looking for machines on a network??Quote:
Originally posted by wxccccc
How can I enumerate logged in machine names ?
Go to MSDN and lookup WNetOpenEnum & WNetEnumResource
I asked the same question quite a while ago.
heres the thread.
http://cboard.cprogramming.com/showt...threadid=20180
What I'm trying to do is run this off a server so that I can get:
IP Machine Name
---- ---------------------
192.168.31.26 Boss_Laptop
192.168.31.94 Manager_HP
I found this example, but I have no idea how to use it !
All i'd like is the machine names (maybe the usernames and ip addresses) in a simple 1D array of strings (or more depending the amount of info retrieved) .. so I can use it in a C# program...
Code:Enumerating Users
dwPreferredSize = (sizeof(NET_DISPLAY_USER) + (3 * UNLEN) * s_iMaximumUserCount);
pNDU = NULL;
lError = NetQueryDisplayInformation(NULL, // NULL means LocalMachine
1, // query User information
0, // starting with the first user
s_iMaximumUserCount, // return a max of 100 users
dwPreferredSize, // preferred buffer size
&dwEntriesRead,
reinterpret_cast<void**>(&pNDU));