#include <windows.h>
#include <tchar.h>
#include <stdio.h>
#include <string>
#include <iostream>
using namespace std;
int main() {
TCHAR buf[MAX_COMPUTERNAME_LENGTH + 2];
DWORD buf_size;
buf_size = sizeof buf - 1;
GetComputerName(buf, &buf_size);
string a = buf;
cout << a << endl;
return 0;
}
windows下c++如何读取主机名
最新推荐文章于 2022-07-12 14:44:42 发布