我有一个驻留在网络驱动器上的应用程序。
当程序从桌面上或网络上的XP计算机上运行时,该程序适用于任何用户。当它在桌面上从Win 7运行时,它对每个人都有效,但是当它在网络上从Win 7运行时,对于权限较少的用户来说,它失败了。下面是密码。它在最后一行"Dim searchResult As SearchResult = directorySearcher.FindOne“上失败
Dim adpath As String = "LDAP://OU=orgOU,DC=ad,DC=orgDC,DC=edu"
Dim directoryEntry As New DirectoryEntry(adpath)
directoryEntry.AuthenticationType = AuthenticationTypes.Secure
Dim directorySearcher As New DirectorySearcher(directoryEntry)
directorySearcher.Filter = getFilter(samAccountName)
directorySearcher.SearchScope = SearchScope.Subtree
Dim searchResult As SearchResult = directorySearcher.FindOne有人能告诉我网络权限中缺少什么吗?
发布于 2011-09-08 05:40:58
您似乎在使用无服务器绑定,请尝试设置:
AuthenticationType = AuthenticationTypes.Secure | AuthenticationTypes.ReadonlyServer来自AuthenticationTypes.ReadOnlyServer上的MSDN文档:
对于Active域服务,此标志表示无服务器绑定不需要可写服务器。
此外,您应该处理您的一次性对象,最好是使用语句。类似于:
Using directoryEntry = New DirectoryEntry...
Using directorySearcher = new DirectorySearcher(...https://stackoverflow.com/questions/7339977
复制相似问题