1

我对 NTLM/LDAP 非常陌生,并尝试使用在本地计算机上运行的 NTML 进行身份验证。微软提供的代码(http://support.microsoft.com/kb/326340/en-us)似乎工作,我只是不知道如何连接到它。

我知道身份验证服务正在运行,因为 Contos 8 已设置为使用 NTLM 进行身份验证并且它正在运行。我只是不知道“连接字符串”应该是什么:

我正在尝试:LDAP://CN=machinename 没有运气。

Dim adAuth As LdapAuthentication = New LdapAuthentication("LDAP://CN=LOCALMACHINENAME")
Dim entry As DirectoryEntry = New DirectoryEntry(_path, domainAndUsername, pwd)

建议?

4

1 回答 1

1

在 .NET 3.5 中,您可以使用PrincipalContext.ValidateCredentials对域或机器进行身份验证。

Dim result as Boolean
Using context As New PrincipalContext( ContextType.Machine, Nothing )
    result = context.ValidateCredentials( username, password )
End Using
于 2010-03-16T15:33:25.383 回答