#include <Windows.h>
#include <Lmcons.h>
#include <iostream>
#include "stdafx.h"
using namespace std;
int main()
{
TCHAR username[UNLEN + 1];
DWORD username_len = UNLEN + 1;
GetUserName((TCHAR*)username, &username_len);
wcout << username << endl;
cin.get();
}