我需要找出登录机器的机器名称和用户名。
I have Updated My answer please see my answer !!!!
NetworkBrowser nb = new NetworkBrowser();
IPHostEntry ip = Dns.GetHostEntry(Dns.GetHostName());
foreach (string pc in nb.getNetworkComputers())
{
cmbNetworkComputers.Items.Add(pc);
}
cmbNetworkComputers.SelectedIndex = 0;
上面的代码检索了机器名称,如何获取用户名称?