解决方案 »

  1.   

    查msdn吧
    可以查到一些
    我这里没装完,看不了
      

  2.   

    to itmaster:
      查了,不知道用那一个api?
      你可以到msdn.micorsoft.com查,不用装msdn
      

  3.   

    当他登录时,总要向你发一些数据,不管用什么协议连接,都可以得到他的IP,然后查看这个IP是不是在你的内网IP地址列表里面不就知道了?
      

  4.   

    你们错误理解我的意思了.
    我想做的是:
    从用户那里得到用户帐号和对应的密码,我如何判断此帐号为本domain内或本机的有效的帐号,也就如果此用户为本domain内或本机的帐号,就可以用我的程序。
      

  5.   

    用LogonUser来判断第一次
    LogonUser (username, _T ("."), password, ...);
    这样可以判断是不是本机用户第二次
    LogonUser (username, domainname, password, ...);
    这样可以判断是不是域内用户LogonType使用LOGON32_LOGON_NETWORK
      

  6.   

    成功后,别忘了close掉那个token handle
      

  7.   

    可以通过ADsGetObject函数验证能否绑定成功,来判断某个用户是否为域下用户。From MSDN
    //The following code snippet binds to a user object, 
    //"WinNT:://MyDomain/Users/John" through the WinNT provider.IADsUser    *pUser;
    BSTR        bstrName;
    HRESULT     hr;
    hr = ADsGetObject(L"WinNT://MyDomain/Users/John",
                      IID_IADsUser,
                      (void**) &pUser);
    Requirements
    Windows NT/2000/XP: Included in Windows 2000 and later.
    Redistributable: Requires Active Directory Client Extension on Windows NT 4.0 SP6a and Windows 95/98/Me.
    Header: Declared in Adshlp.h.
    Library: Use ActiveDS.lib.
      

  8.   

    http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/Q180/5/48.asp&NoWebContent=1有完整的例子和源代码