#include <iostream>
#include <windows.h>
#pragma comment(lib,"Advapi32.lib")
using
namespace
std;
int
main()
{
char
strBuffer[256] ={0};
DWORD
dwSize = 256;
GetUserName(strBuffer,&dwSize);
cout<<
"当前用户名:"
<<strBuffer<<endl;
return
0;
}