views:

22

answers:

1

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
Thanks. This is exactly what I was looking for.
Jeff