pcaccount Delphi/간단하게 간단하게 사용자 계정 이름 가져오기 function GetCurrentUserName : string; const cnMaxUserNameLen = 254; var sUserName: string; dwUserNameLen: DWORD; begin dwUserNameLen := cnMaxUserNameLen - 1; SetLength(sUserName, cnMaxUserNameLen); GetUserName(PChar(sUserName), dwUserNameLen); SetLength(sUserName, dwUserNameLen); Result := sUserName;end; Delphi/간단하게 간단하게 PC 이름 가져오기 function getComputerName: string; var buffer : array [0 .. MAX_COMPUTERNAME_LENGTH + 1] of Char; Size : Cardinal; begin Size := MAX_COMPUTERNAME_LENGTH + 1; GetComputerNameW(@buffer, Size); Result := StrPas(buffer); end; 이전 1 다음