ip地址private string AddWindowsUser(string strDoamin, string strLogin, string strPwd)
{
DirectoryEntry obDirEntry = null;
try
{
obDirEntry = new DirectoryEntry("WinNT://" + strDoamin);
DirectoryEntries entries = obDirEntry.Children;
DirectoryEntry obUser = entries.Add(strLogin, "User");
obUser.Properties["FullName"].Add("Amigo");
object obRet = obUser.Invoke("SetPassword", strPwd);
obUser.CommitChanges();
return "";
}
catch (Exception ex)
{
//MessageBox.Show(ex.Message);
return ex.Message;
}
}
C#根据计算机名获取对应IP地址
80酷酷网 80kuku.com