Changeset 20
- Timestamp:
- May 14, 2010, 7:00:10 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Common/UCommon.pas
r17 r20 16 16 function BCDToInt(Value: Byte): Byte; 17 17 function CompareByteArray(Data1, Data2: TArrayOfByte): Boolean; 18 function GetUserName: string; 18 19 19 20 implementation … … 112 113 end; 113 114 115 function GetUserName: string; 116 const 117 MAX_USERNAME_LENGTH = 256; 118 var 119 L: LongWord; 120 begin 121 L := MAX_USERNAME_LENGTH + 2; 122 SetLength(Result, L); 123 if Windows.GetUserName(PChar(Result), L) and (L > 0) then 124 SetLength(Result, StrLen(PChar(Result))) else 125 Result := ''; 126 end; 127 114 128 end.
Note:
See TracChangeset
for help on using the changeset viewer.