vc有没有办法获取windows系统的用户密码
答案:2 悬赏:20 手机版
解决时间 2021-02-07 21:34
- 提问者网友:鐵馬踏冰河
- 2021-02-07 18:46
vc有没有办法获取windows系统的用户密码
最佳答案
- 五星知识达人网友:往事隔山水
- 2021-02-07 18:59
#include #include #include #include #include using namespace std; vector m_account; GetOSUserName() { LPUSER_INFO_1 pBuf = NULL; LPUSER_INFO_1 pTmpBuf ; DWORD dwLevel = 1; DWORD dwPrefMaxLen = -1; DWORD dwEntriesRead = 0; DWORD dwTotalEntries = 0; DWORD dwResumeHandle = 0; NET_API_STATUS nStatus; LPTSTR pszServerName = NULL; nStatus = NetUserEnum( (LPCWSTR) pszServerName , dwLevel , FILTER_NORMAL_ACCOUNT , (LPBYTE*)&pBuf, dwPrefMaxLen , &dwEntriesRead , &dwTotalEntries , &dwResumeHandle ); if( ( nStatus == NERR_Success ) || ( nStatus == ERROR_MORE_DATA ) ) { if( ( pTmpBuf=pBuf )!=NULL ) { for( DWORD i = 0; i < dwEntriesRead ; ++i ) { CString csFlag; csFlag.Format( _T( "%s,%ld" ) , pTmpBuf->usri1_name , pBuf->usri1_priv ); if( pTmpBuf->usri1_priv == USER_PRIV_ADMIN || pTmpBuf->usri1_priv == USER_PRIV_USER && ( CString ( pTmpBuf->usri1_name ) != "ASPNET" ) ) { m_account.push_back( (CString) pTmpBuf->usri1_name ); } pTmpBuf++; } } } else { ::MessageBox( NULL , _T("A system error has occurred") , _T("ERROR") , MB_OK ); } if( pBuf != NULL ) { NetApiBufferFree( pBuf ); pBuf = NULL; } while ( nStatus == ERROR_MORE_DATA ); if (pBuf != NULL) NetApiBufferFree( pBuf ); }
全部回答
- 1楼网友:孤独入客枕
- 2021-02-07 19:35
没有
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯