(Gast)
n/a Beiträge
|
Re: Computernamen auslesen unter RAD 2009 und Vista
2. Mär 2009, 15:11
ANSI
Delphi-Quellcode:
var
nSize: Cardinal;
lName: AnsiString;
begin
nSize := MAX_COMPUTERNAME_LENGTH;
SetLength(lName, nSize+1);
if GetComputerNameA(lName, nSize) then
begin
SetLength(lName, nSize);
end;
end;
WIDE
Delphi-Quellcode:
var
nSize: Cardinal;
lName: WideString;
begin
nSize := MAX_COMPUTERNAME_LENGTH;
SetLength(lName, nSize+1);
if GetComputerNameW(lName, nSize) then
begin
SetLength(lName, nSize);
end;
end;
|
|
Zitat
|