Taggs Posted February 18, 2005 Author Posted February 18, 2005 OK thanks for trying! Anybody else got any idea's? I'll have a look elsewhere aswell, If I find an answer I'll post back here.
Taggs Posted February 18, 2005 Author Posted February 18, 2005 BINGO unit Unit1;interfaceuses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;type TForm1 = class(TForm) Label1: TLabel; Label2: TLabel; Button1: TButton; procedure Button1Click(Sender: TObject); function GetComputerName1:string; private { Private declarations } public { Public declarations } end;var Form1: TForm1;implementation{$R *.DFM}procedure TForm1.Button1Click(Sender: TObject);beginShowMessage (GetComputerName1);end;function TForm1.GetComputerName1:string;varbuffer: array[0..255]of char;Size: dword; beginSize := MAX_COMPUTERNAME_LENGTH + 1;GetComputerName(buffer,size);Result := StrPas(buffer);end;end.Thanks again for the help.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now