MSDN 中介绍描述比较模糊,"Updates the CSid object given the account name and domain, or an existing SID (security identifier) structure."
bool LoadAccount(
   LPCTSTR pszAccountName,
   LPCTSTR pszSystem = NULL 
) throw(...);
bool LoadAccount(
   const SID * pSid,
   LPCTSTR pszSystem = NULL 
) throw(...);
pszAccountName
The account name.pszSystem
The system name. This string can be the name of a remote computer. If this string is NULL, the local system is used instead.pSid
A pointer to a SID structure.我想校验一下一个域用户能否在这台机器上登陆,我应该如何给这个函数传递参数呢?请教。

解决方案 »

  1.   

    假设我两台电脑,一台 Win7x64,一台 Win10x64,分别都加入了域 testdomain.com,但都从未登陆到与服务器上,加入时使用与服务器的管理员账户加入的域。此时我在 Win7 系统上调用 LoadAccount 传入我域服务器一个已存在的用户名 jia.deng 返回 true。
    而在 Win10 系统上调用 LoadAccount 传入相同的用户名 jia.deng 就返回 false。sid.LoadAccount(_T("jia.deng"));请问这是什么原因?