本文介绍了失去与Active Directory的连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 限时删除!! 我有网络应用程序,可以查询Active Directory以获取用户 详细信息..一切正常但有一天我会得到 System.Runtime.InteropServices。 COMExection,如果我重新启动客户端 机器,那么它再次工作。 这里是调用AD的方法之一 public bool UserExist(string UserName) { DirectoryEntry de = new DirectoryEntry(ConfigurationSettings。 AppSettings [" ADPath"]); DirectorySearcher ds = new DirectorySearcher(de); ds.Filter =(" ObjectCategory = user"); ds.Filter =(" samaccountname =" + UserName +""); SearchResult result = ds.FindOne(); bool UserExist; if(result!= null) { UserExist = true; } else { UserExist = false; } 返回UserExist; } 请帮助I have web application that quaries the Active Directory to get userdetails.. everything works fine but someday I''ll getSystem.Runtime.InteropServices.COMExection and if I restart the clientmachine then it works again.here is one of the method where am calling the ADpublic bool UserExist(string UserName){DirectoryEntry de = newDirectoryEntry(ConfigurationSettings.AppSettings["ADPath"]);DirectorySearcher ds = new DirectorySearcher(de);ds.Filter = ("ObjectCategory=user");ds.Filter = ("samaccountname="+ UserName + "");SearchResult result = ds.FindOne();bool UserExist;if(result != null){UserExist = true;}else{UserExist = false;}return UserExist;}Please help推荐答案 这篇关于失去与Active Directory的连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 1403页,肝出来的.. 09-07 23:45