Board index » delphi » Getting the network name of the local computer...

Getting the network name of the local computer...

Hi all, I'm not sure if this is the correct newsgroup, but here goes
anyway...

I have written a game that works across a LAN/Internet and I was wondering
how to get the name of the local computer so I can send this info to the
other player for displaying...

Thanks in advance,
Paul Nicholls (Delphi 5)
"The plastic veneer of civilized man is easily melted in the heat of the
moment" - Paul Nicholls

 Home Page: www.southcom.com.au/~phantom

 

Re:Getting the network name of the local computer...


In article <3bd8dd74$1_1@dnews>, paul_f_nicho...@hotmail.com says...

Quote
> Hi all, I'm not sure if this is the correct newsgroup, but here goes
> anyway...

> I have written a game that works across a LAN/Internet and I was wondering
> how to get the name of the local computer so I can send this info to the
> other player for displaying...

procedure TForm1.Button1Click(Sender: TObject);
 var
  size:dword;
  LocalMachine:array [0..MAX_COMPUTERNAME_LENGTH] of char;
 begin
  size:=Sizeof(LocalMachine);
  if GetComputerName(LocalMachine,size) then ShowMessage(LocalMachine);
 end;

-------------------------------
Paul Lambadaris
Delta Singular S.A.
mailto : p...@singular.gr
www    : http://www.singular.gr

Re:Getting the network name of the local computer...


Thanks Paul :)

--
Paul Nicholls (Delphi 5)
"The plastic veneer of civilized man is easily melted in the heat of the
moment" - Paul Nicholls

 Home Page: www.southcom.com.au/~phantom

Quote
"Paul Lambadaris" <p...@singular.gr> wrote in message > > how to get the name

of the local computer so I can send this info to the
Quote
> > other player for displaying...

> procedure TForm1.Button1Click(Sender: TObject);
>  var
>   size:dword;
>   LocalMachine:array [0..MAX_COMPUTERNAME_LENGTH] of char;
>  begin
>   size:=Sizeof(LocalMachine);
>   if GetComputerName(LocalMachine,size) then ShowMessage(LocalMachine);
>  end;

Other Threads