草庐IT

c++ - 如何在 Windows 中获取当前登录用户的域?

我知道我可以通过调用GetUserName获取当前登录的用户名.我正在寻找返回该用户域的API函数。 最佳答案 参见HowtoretrievecurrentuseranddomainnamesonWindowsNT,Windows2000,orWindowsXP.例子:#defineUNICODE#define_UNICODE#include#includeBOOLGetCurrentUserAndDomain(PTSTRszUser,PDWORDpcchUser,PTSTRszDomain,PDWORDpcchDomain){BO