我必须找到机器名称和登录机器的用户名。
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;
上面的代码检索机器名,如何获取用户名?