[Lazarus] Finding out the Hostname of the Computer.

Sergei Gorelkin sergei_gorelkin at mail.ru
Thu Nov 27 20:43:10 CET 2008


Dave Coventry wrote:

> ...
> Can anyone see what I'm doing wrong, or offer an alternative way of
> getting the name of the computer?

A simple

result := GetEnvironmentVariable('HOSTNAME');

should do it.
Alternatively, you may read the /etc/hostname file just as you read any 
other text file.

Regards,
Sergei




More information about the Lazarus mailing list