C# - Get workgroup name
johnb2201
0
Reputation points
Using Visual Studio 2010 - C#
I want to get the computers workgroup name.
I tried both of these on Windows XP:
string workgroupName = Environment.GetEnvironmentVariable("UserDomainName");
string workgroupName = (string)Registry.GetValue(key1, "Workgroup", null);
The first gives me the computer name.
The second is blank.
Please suggest a solution that will work on all versions of Windows.
Windows for business | Windows Client for IT Pros | Networking | Network connectivity and file sharing
Sign in to answer