真实的国产乱ⅩXXX66竹夫人,五月香六月婷婷激情综合,亚洲日本VA一区二区三区,亚洲精品一区二区三区麻豆

成都創(chuàng)新互聯(lián)網(wǎng)站制作重慶分公司

windows下C++獲取用戶相關(guān)信息-創(chuàng)新互聯(lián)

主要流程如下:
1、獲取所有用戶
2、調(diào)用api獲取用戶相關(guān)信息

成都創(chuàng)新互聯(lián)專注為客戶提供全方位的互聯(lián)網(wǎng)綜合服務(wù),包含不限于網(wǎng)站建設(shè)、網(wǎng)站設(shè)計(jì)、東川網(wǎng)絡(luò)推廣、微信小程序、東川網(wǎng)絡(luò)營(yíng)銷、東川企業(yè)策劃、東川品牌公關(guān)、搜索引擎seo、人物專訪、企業(yè)宣傳片、企業(yè)代運(yùn)營(yíng)等,從售前售中售后,我們都將竭誠(chéng)為您服務(wù),您的肯定,是我們大的嘉獎(jiǎng);成都創(chuàng)新互聯(lián)為所有大學(xué)生創(chuàng)業(yè)者提供東川建站搭建服務(wù),24小時(shí)服務(wù)熱線:18980820575,官方網(wǎng)址:www.cdcxhl.com
bool GetUserInfo(WCHAR* username)
{//用戶信息
	LPUSER_INFO_2 pBuf = NULL;
	LPUSER_INFO_2 pBuf2 = NULL;
	LPUSER_INFO_4 pBuf4 = NULL;
	//獲取用戶信息
	if (NetUserGetInfo(NULL, username, 4, (LPBYTE*)&pBuf4) == NERR_Success ||
		NetUserGetInfo(NULL, username, 2, (LPBYTE*)&pBuf2) == NERR_Success) {if (pBuf4 != NULL)
			pBuf = (LPUSER_INFO_2)pBuf4;
		else
			pBuf = pBuf2;

		if (pBuf == NULL) {	return FALSE;
		}

		if (pBuf != NULL)
			NetApiBufferFree(pBuf);
	}
	return TRUE;
}

bool GetUserGroup(WCHAR* username)
{LPLOCALGROUP_USERS_INFO_0 plgus0 = NULL;
	LPLOCALGROUP_USERS_INFO_0 plgus1 = NULL;
	LPGROUP_USERS_INFO_0 pgus0 = NULL;
	LPGROUP_USERS_INFO_0 pgus1 = NULL;

	DWORD group_entriesread = 0;
	DWORD group_totalentries = 0;
	
	//獲取用戶組信息
	if (NetUserGetLocalGroups(NULL, username, 0, LG_INCLUDE_INDIRECT, (LPBYTE*)&plgus0, MAX_PREFERRED_LENGTH, &group_entriesread, &group_totalentries) == NERR_Success)
	{if ((plgus1 = plgus0) != NULL)
		{	for (int j = 0; j< (int)group_entriesread; j++)
			{		//用戶組信息
				plgus1++;
			}
			NetApiBufferFree(plgus0);
		}
	}
	// 獲取全局組成員
	pgus0 = NULL;
	if (NetUserGetGroups(NULL, username, 0, (LPBYTE*)&pgus0, MAX_PREFERRED_LENGTH, &group_entriesread, &group_totalentries) == NERR_Success)
	{if ((pgus1 = pgus0) != NULL)
		{	for (int j = 0; j< (int)group_entriesread; j++)
			{		//用戶組信息
				pgus1++;
			}
			NetApiBufferFree(pgus0);
		}
	}



	return TRUE;
}

int user_enum()
{LPUSER_INFO_0 pBuf = NULL;
	LPUSER_INFO_0 pTmpBuf;
	DWORD dwLevel = 0;
	LPTSTR pszServerName = NULL;
	DWORD dwPrefMaxLen = MAX_PREFERRED_LENGTH;
	DWORD dwEntriesRead = 0;
	DWORD dwTotalEntries = 0;
	DWORD dwResumeHandle = 0;
	DWORD i = 0;

	CHAR szUserUtf8[260] = {0 };
	CHAR szUtf8[512] = {0 };

	DWORD len = 0;
	NET_API_STATUS nStatus;
	int arrayIndex1 = 1;

	//獲取所有用戶信息
	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 (i = 0; (i< dwEntriesRead); i++)
			{		assert(pTmpBuf != NULL);
				if (pTmpBuf == NULL)
				{fprintf(stderr, "An access violation has occurred\n");
					break;
				}

				WideToUtf8_L(pTmpBuf->usri0_name, szUserUtf8, 260);

				if (match != NULL)
				{if (wildcardcmp(match, szUserUtf8) == 0)
					{pTmpBuf++;
						dwTotalCount++;
						continue;
					}
				}

				UserInfo* info = (UserInfo*)malloc(sizeof(UserInfo));
				memset(info, 0, sizeof(UserInfo));
				
				pTmpBuf++;
			}
		}
	}

	if (pBuf != NULL) {NetApiBufferFree(pBuf);
		pBuf = NULL;
	}

	return 1;
}

你是否還在尋找穩(wěn)定的海外服務(wù)器提供商?創(chuàng)新互聯(lián)www.cdcxhl.cn海外機(jī)房具備T級(jí)流量清洗系統(tǒng)配攻擊溯源,準(zhǔn)確流量調(diào)度確保服務(wù)器高可用性,企業(yè)級(jí)服務(wù)器適合批量采購(gòu),新人活動(dòng)首月15元起,快前往官網(wǎng)查看詳情吧


文章名稱:windows下C++獲取用戶相關(guān)信息-創(chuàng)新互聯(lián)
文章位置:http://weahome.cn/article/deigoj.html

其他資訊

在線咨詢

微信咨詢

電話咨詢

028-86922220(工作日)

18980820575(7×24)

提交需求

返回頂部