#include "stdafx.h"
#include "windows.h"
#include "string"
using namespace std;
wstring myComputerName( )
{
TCHAR szHostName[200];
DWORD dwSize = 200;
GetComputerName( szHostName, &dwSize );
return wstring( szHostName);
}
int _tmain(int argc, _TCHAR* argv[])
{
setlocale(LC_ALL ,"chs");
wstring w = myComputerName();
wprintf( L"%s/n", w.c_str());
getchar();
return 0;
}