from ctypes import *
from ctypes.wintypes import HANDLE
# Example use of WinAPI
windll.user32.MessageBoxW(None, u"Example", u"Example", 0)
x = HANDLE()
print windll.advapi32.LogonUserW(u"Tupteq", None, u"passwd", 4, 0, pointer(x))
print windll.kernel32.GetLastError()
print x
您可以使用ctypes。这个例子似乎有效(Python2.7):
在我的例子中,
GetLastError()
在密码错误的情况下返回1326
,在密码正确的情况下返回1327
您可能需要调整
dwLogonType
和dwLogonProvider
的值相关问题 更多 >
编程相关推荐