How do I determine which network domain I am connected to from VB.Net?
+2
A:
To get the current domain name, you can use Environment.UserDomainName
(if the user in whose context the application is running is a domain user).
Alternatively, NetworkInformation.IPGlobalProperties.GetIPGlobalProperties().DomainName
will return the domain name independent of the current user (or an empty string, if the PC is not member of a domain).
Heinzi
2009-12-22 17:00:44
Thanks. This is exactly what I was looking for.
Jeff
2009-12-22 17:20:51