new DirectoryEntry("") 为空是什么意思啊?一样可以获取电脑名....
DirectoryEntry DirectEntry = new DirectoryEntry(""); 这个path为空是什么意思这个仍然可以获取好多台电脑,这个获取的电脑是哪里的电脑啊? 有的写的"WinNt:"什么的是什么意思?
--------------------编程问答-------------------- 那就是默认的了罢. --------------------编程问答-------------------- 那默认的是获取哪里的电脑啊?
public static SearchResultCollection GetResCollection(string Filter)
{
try
{
DirectoryEntry DirectEntry = new DirectoryEntry("");
DirectorySearcher Sear = new DirectorySearcher(DirectEntry);
Sear.Filter = Filter;
Sear.PropertyNamesOnly = true;
Sear.PropertiesToLoad.Add("name");
Sear.ReferralChasing = ReferralChasingOption.None;
Sear.Sort = new SortOption("name", SortDirection.Ascending);
return Sear.FindAll();
}
catch (Exception ex)
{
throw ex;
}
}
好像不是当前域下的啊?
如果要获取指定域下的电脑怎么写? --------------------编程问答-------------------- http://technet.microsoft.com/zh-cn/magazine/system.directoryservices.directoryentry.path(VS.80).aspx
http://www.cnblogs.com/kakimsun/archive/2010/04/27/1721678.html --------------------编程问答-------------------- 此 DirectoryEntry 对象的路径。默认值为空字符串 ("")
但是还是没搞清空字符串的时候查询的是哪里的计算机啊?
补充:.NET技术 , C#