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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I get the workgroup name of a computer

Status
Not open for further replies.

ugagrad

Programmer
Sep 12, 2003
49
US
Hello all,
I was wondering if anyone had any code snippets on how to get the workgroup name of a computer in Windows 98 and ME. I would rather not use the Windows registry. I used NetWkstaGetInfo function for 2000 and XP. Does anyone have any suggestions.
Thank you in advance
 
Hi .Think that this will help you.Try It

procedure TForm1.Button1Click(Sender: TObject);
Var
arrCompName : Array[0..255] Of Char;
strCompName : String;
CompNameLen : Integer;
// CompNameLen : Cardinal; If using Delphi4
// Thanks to Kurt Troncquo
begin
CompNameLen := MAX_COMPUTERNAME_LENGTH + 1;
If GetComputerName(arrCompName, CompNameLen) Then
Begin
SetLength(strCompName, MAX_COMPUTERNAME_LENGTH + 1);
Label1.Caption := StrPas(arrCompName);
End;
end;

Good Luck

Good Luck !
Spent
mail:spentbg@yahoo.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top