16,467
社区成员
发帖
与我相关
我的任务
分享
DWORD nResult=0;
DWORD nLength=0;
nResult=::GetNetworkParams(NULL,&nLength);
if (nResult!=ERROR_BUFFER_OVERFLOW)
{
return;
}
FIXED_INFO* pFixedInfo=(FIXED_INFO*)new BYTE[nLength];
nResult=::GetNetworkParams(pFixedInfo,&nLength);
if (nResult!=ERROR_SUCCESS)
{delete[]pFixedInfo;
return;
}
CString strText=_T("");
strText.Format(_T("本地计算机的名称:%s"),pFixedInfo->HostName);
AfxMessageBox(strText);
delete[]pFixedInfo;