Subject | Detect the name of the Server |
---|---|
Author | Arn |
Post date | 2004-05-10T09:59:39Z |
Never mind, I have found it myself.
If someone is interested here is the code, taken from Torry's Delphi page.
The Autor is : Simon Grossenbacher
{ Retrieve the computer name }
function GetComputerName: string;
var
buffer: array[0..MAX_COMPUTERNAME_LENGTH + 1] of Char;
Size: Cardinal;
begin
Size := MAX_COMPUTERNAME_LENGTH + 1;
Windows.GetComputerName(@buffer, Size);
Result := StrPas(buffer);
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
ShowMessage(GetComputerName);
end;
Ciao
Arnaldo
If someone is interested here is the code, taken from Torry's Delphi page.
The Autor is : Simon Grossenbacher
{ Retrieve the computer name }
function GetComputerName: string;
var
buffer: array[0..MAX_COMPUTERNAME_LENGTH + 1] of Char;
Size: Cardinal;
begin
Size := MAX_COMPUTERNAME_LENGTH + 1;
Windows.GetComputerName(@buffer, Size);
Result := StrPas(buffer);
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
ShowMessage(GetComputerName);
end;
Ciao
Arnaldo