-workgroup
function GetWorkgroup: string;
var
reg : TRegistry;
begin
reg := TRegistry.Create;
try
reg.Rootkey := HKEY_LOCAL_MACHINE;
reg.Openkey('system\CurrentControlSet\Services\VxD\VNETSUP', False);
Result := reg.ReadString('Workgroup');
finally
reg.Free;
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
label1.caption:=GetWorkgroup;
end;
----------------------------------------------------------------------
-computer name
function GetPCName: string;
var
reg : TRegistry;
begin
reg := TRegistry.Create;
try
reg.Rootkey := HKEY_LOCAL_MACHINE;
reg.Openkey('system\CurrentControlSet\Services\VxD\VNETSUP', False);
Result := reg.ReadString('ComputerName');
finally
reg.Free;
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
label1.caption:=GetPCName;
end;
---------------------------------------------------------------------
-file sharing
function GetFileshare: string;
var
reg : TRegistry;
begin
reg := TRegistry.Create;
try
reg.Rootkey := HKEY_LOCAL_MACHINE;
reg.Openkey('system\CurrentControlSet\Services\VxD\VNETSUP', False);
Result := reg.ReadString('FileSharing');
finally
reg.Free;
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
label1.caption:=GetFileshare;
end;
----------------------------------------------------------------------
-print sharing
function GetPrintshare: string;
var
reg : TRegistry;
begin
reg := TRegistry.Create;
try
reg.Rootkey := HKEY_LOCAL_MACHINE;
reg.Openkey('system\CurrentControlSet\Services\VxD\VNETSUP', False);
Result := reg.ReadString('PrintSharing');
finally
reg.Free;
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
label1.caption:=GetPrintshare;
end;
----------------------------------------------------------------------
-server list
function GetServerlist: string;
var
reg : TRegistry;
begin
reg := TRegistry.Create;
try
reg.Rootkey := HKEY_LOCAL_MACHINE;
reg.Openkey('system\CurrentControlSet\Services\VxD\VNETSUP', False);
Result := reg.ReadString('MaintainServerList');
finally
reg.Free;
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
label1.caption:=GetServerlist;
end;
----------------------------------------------------------------------
-owner
function GetOwners: string;
var
reg : TRegistry;
begin
reg := TRegistry.Create;
try
reg.Rootkey := HKEY_LOCAL_MACHINE;
reg.Openkey('software\Microsoft\Windows\CurrentVersion', False);
Result := reg.ReadString('RegisteredOwner');
finally
reg.Free;
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
label1.caption:=GetOwners;
end;
----------------------------------------------------------------------
-organisation
function GetOrgan: string;
var
reg : TRegistry;
begin
reg := TRegistry.Create;
try
reg.Rootkey := HKEY_LOCAL_MACHINE;
reg.Openkey('software\Microsoft\Windows\CurrentVersion', False);
Result := reg.ReadString('RegisteredOrganization');
finally
reg.Free;
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
label1.caption:=GetOrgan;
end;
-----------------------------------------------------