Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can I get the windows95 COMPUTER NAME using Delphi 4

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hi

Does anyone know of a method to get the 'COMPUTER NAME'specified in NETWORKNEIGHBOURHOOD->PROPERTIES->IDENTIFICATION
from a remote networked computer. Surely it must be specified in the registery somewhere?

I want to do something like this....


IF 'computer name' is found
then
add it to a text file and run this program.

cheers
 
function GetCurComputer : string;
var
nSize : Cardinal;
LocalMachine: array [0..MAX_COMPUTERNAME_LENGTH] of Char;
begin
nSize := Sizeof(LocalMachine);
if GetComputerName(LocalMachine,nSize) then
Result := LocalMachine
else
Result := '';
end;

Hope this helps you!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top