vjnwarp
asked on
computer name, workgroup and computer description
is there a visual basic command that can return the computer name and workgroup of the current user? coz i need this in doing a workgroup system.... and i need a pathname in network neighborhood e.g "\\Noel\noel c\mbf2"
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
If you need to connect to a network path you will have to use some API's, I have made a class to simplify network accessing such as connection a shared network folder (!) but you can also find code for listing all available workgroups, listing all computers in a workgroup etc
http://www.cyd.liu.se/~freqv416/clsNetwork.cls
You will have to comment the Workgroup function, this function gets the value of the key in the comment above, but the function uses a registry class file I have (I do like class files yes). If you want to use that function too the registry class file is at
http://www.cyd.liu.se/~freqv416/clsRegistry.cls
http://www.cyd.liu.se/~freqv416/clsNetwork.cls
You will have to comment the Workgroup function, this function gets the value of the key in the comment above, but the function uses a registry class file I have (I do like class files yes). If you want to use that function too the registry class file is at
http://www.cyd.liu.se/~freqv416/clsRegistry.cls
Don't know if setiawan ansered the wrong question here (?) but I liked the comment in the code
"... expressly forbidden from selling or otherwise
distributing this source code without prior written consent.
This includes both posting free demo projects made from this
code as well as reproducing the code in text or html format. "
;)
"... expressly forbidden from selling or otherwise
distributing this source code without prior written consent.
This includes both posting free demo projects made from this
code as well as reproducing the code in text or html format. "
;)
Oh, and if you do not know how to read registry keys you can of course use my registry class, it's (still) at..
http://www.cyd.liu.se/~freqv416/clsRegistry.cls
http://www.cyd.liu.se/~freqv416/clsRegistry.cls
Hi Vbmaster,
about the comment, I have included the source from vbnet. (I'm not claim that, It was my code).
I just don't get it, why people says something like " you can use freely ... forbidden from selling (this one I'm agree) but what about don't distribute ?
so why did they put it on the internet ?
danny
about the comment, I have included the source from vbnet. (I'm not claim that, It was my code).
I just don't get it, why people says something like " you can use freely ... forbidden from selling (this one I'm agree) but what about don't distribute ?
so why did they put it on the internet ?
danny
ASKER
what data it will return, is it the computer name? what about the their workgroup they working on?
winwarp: why accept the answer before you even read the code given?
setiawan: i guess they want you to give a URL to their site, so they become bigger and get more money from the advertisement on their pages..
setiawan: i guess they want you to give a URL to their site, so they become bigger and get more money from the advertisement on their pages..
vjnwarp, the code I proposed will return computer name and IP address
(the code taken from VBNet, www.mvps.org/vbnet)
Vbmaster, I don't think MVPS or other site like Planet source code looking for profit.
danny
(the code taken from VBNet, www.mvps.org/vbnet)
Vbmaster, I don't think MVPS or other site like Planet source code looking for profit.
danny
ASKER
coz i accidentally click the option button accept so i can't remove it..... i am thinking to accept it and come up with a question but i can't remove the option in accept... so that's all...
but i think it can help me in other ways...
but i think it can help me in other ways...
Computer Name:
HKEY_LOCAL_MACHINE\System\
Workgroup:
HKEY_LOCAL_MACHINE\System\