function GetNetWorkgroup : string; var Reg : TRegistry; begin Reg := TRegistry.create; Result := '(n/a)'; with Reg do try RootKey := HKEY_LOCAL_MACHINE; if OpenKey('System\CurrentControlSet\Services\VxD\VNETSUP', false) then Result := ReadString('Workgroup'); finally CloseKey; free; end; end;
var
Reg : TRegistry;
begin
Reg := TRegistry.create;
Result := '(n/a)';
with Reg do
try
RootKey := HKEY_LOCAL_MACHINE;
if OpenKey('System\CurrentControlSet\Services\VxD\VNETSUP',
false) then
Result := ReadString('Workgroup');
finally
CloseKey;
free;
end;
end;
那个代码也是用ActiveDS Typelib管理Window用户的