A
anydelphi
Unregistered / Unconfirmed
GUEST, unregistred user!
wchar_t UserName [0x400];
memset(UserName,0,sizeof (UserName));
GetEnvironmentVariableW(L"USERNAME",UserName,0x400);
我是这样理解的,可惜编译没有通过
UserName : array [0..$400] of WideChar;
FillChar(UserName,Sizeof (UserName),#0);
GetEnvironmentVariableW(PWideChar('USERNAME'),UserName,$400);
memset(UserName,0,sizeof (UserName));
GetEnvironmentVariableW(L"USERNAME",UserName,0x400);
我是这样理解的,可惜编译没有通过
UserName : array [0..$400] of WideChar;
FillChar(UserName,Sizeof (UserName),#0);
GetEnvironmentVariableW(PWideChar('USERNAME'),UserName,$400);