How Can I get the following from a computer using VB6?
domain, user id, machine name, machine IP
any APIs I can use?
Printable View
How Can I get the following from a computer using VB6?
domain, user id, machine name, machine IP
any APIs I can use?
For UserID and Machine name, see the "API" section of our Classic VB FAQs (in the FAQ forum, which is shown near the top of our home page)
For the others, I would recommend a search of the API forum, or this one.
Oh never mind... I got it through...
and IpAddress through the code hereCode:domain = Environ("USERDOMAIN")
userId = Environ("USERNAME")
machineName = Environ("COMPUTERNAME")
While simple, Environ is not a particularly good idea - it can be edited by the user or other programs, so may not actually have the right info.
The use for this app I'm making is well simple I suppose.
So I'll definitely come back here if the user comes back and says some data was changed. :)