Subject RE: [IBO] Detect the name of the Server
Author Alan McDonald
> 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

That's not the name of the server (necessarily) - just the name of the
computer running that procedure. In this case, the name of the server is
also 'localhost'
Alan