WINDOWS2000下怎么获得登陆的用户名?怎么获得登陆用户的地址?

解决方案 »

  1.   

    地址是什么意思
    如果你想得到当前登录用户的用户名和密码,那么你要重写一下GINA.DLL是如果你只想得到当前进入系统的用户名,我写了个函数也许有用户:
    CString CGetUserInfo::GetSystemUserName()
    {
    LPTSTR lpszSystemInfo;
    TCHAR tchBuffer[256];
    lpszSystemInfo = tchBuffer; 
    DWORD dwResult;
    //取环境变量
    dwResult = ExpandEnvironmentStrings("USERPROFILE=%USERPROFILE%", 
    lpszSystemInfo, 
    256);
    //构造用以存入私钥的目录
    if( dwResult ==0)
    return "";
    CString strPath = lpszSystemInfo;
    strPath = strPath.Right( strPath.GetLength() - strlen("USERPROFILE="));
    strPath = strPath.Right( strPath.GetLength() -strPath.ReverseFind( '\\')-1);
    return strPath;
    }
      

  2.   

    我知道他访问了那个程序,也知道会话ID了,下一不怎么知道他的IP呢?????????