use Registry
.....
var
Reg: TRegistry;
Workgroup,ComputerName:string;
begin
Reg := TRegistry.Create;
try
Reg.RootKey := HKEY_LOCAL_MACHINE;
if Reg.OpenKey('/System/CurrentControlSet/Services/VxD/VNETSUP',False)
then
begin
Workgroup:=Reg.ReadString('Workgroup');//工作组
ComputerName:=Reg.ReadString('ComputerName');//计算机名
end;
finally
Reg.CloseKey;
Reg.Free;
end;
end;