hello
i want to get workgroup of the computer without using unmanaged code
i try this
System.Environment.UserDomainName
but its giving me the COMPUTER NAME not the workgroup ... is there any way to find out using System.NET or WMI
thanx any way ..
hello
i want to get workgroup of the computer without using unmanaged code
i try this
System.Environment.UserDomainName
but its giving me the COMPUTER NAME not the workgroup ... is there any way to find out using System.NET or WMI
thanx any way ..
How to get workgroup of the computer?
Big_Al
Try this, or something like it:
My
.Computer.Registry.LocalMachine.OpenSubKey("System\CurrentControlSet\Services\Tcpip\Parameters\", False).GetValue("Domain")false420
viki
If that doesn't work, you should be able to use the WMI tools in the System.Management namespace (located in system.management.dll).
sample code.
SelectQuery query = new SelectQuery("Win32_ComputerSystem");
ManagementObjectSearcher searcher = new ManagementObjectSearcher(query);
foreach (ManagementObject mo in searcher.Get())
{
workGroupName = mo["Workgroup"] as string;
}
smartinz
Little Shell