如何判断NT中用户的密码对不对(100分)

  • 主题发起人 nathanlee
  • 开始时间
N

nathanlee

Unregistered / Unconfirmed
GUEST, unregistred user!
有什么函数可以判断用户输入的密码于NT中域用户的密码是否一致
 
Windows SDK 有个函数叫 LogonUser, 你提供用户名,域名和密码,它执行一个用户
登陆的操作并返回一个布尔值告诉你是否成功,如果成功还有一个句柄返回。但是这个
函数我在 XP 下编写并在 XP 下测试是正常的,拿到 Win 2000 下就不正常了,看看
你测试的怎么样告诉我一声。OK ?
 
to nathanlee:

建议用LOgonUser函数。该函数查找注册表,检查指定参数的
用户信息是否存在。它的API 的申明形式如下:
BOOL LogonUser(
LPTSTR lpszUsername, // string that specifies the user name
LPTSTR lpszDomain, // string that specifies the domain or server
LPTSTR lpszPassword, // string that specifies the password
DWORD dwLogonType, // specifies the type of logon operation
DWORD dwLogonProvider, // specifies the logon provider
PHANDLE phToken // pointer to variable to receive token handle
);

 
能不能给各具体的例子
 
多人接受答案了。
 
顶部