将C盘共享
Uses Registry;
procedure TForm_Main.p_write_reg(Integer:li_int);
var
lr_reg: TRegistry;
begin
lr_reg := TRegistry.Create;
try
lr_reg.RootKey := HKEY_CURRENT_USER;
if lr_reg.OpenKey('/Software/Microsoft/Windows/CurrentVersion/Network/LanMan/C$',True) then
begin
lr_reg.WriteInteger('Flags',302);
lr_reg.WriteInteger('Type',0);
lr_reg.WriteInteger('Path',C:/);
end;
//then
finally
Reg.CloseKey;
Reg.Free;
inherited;
end;
//try
end;
就记住这么多,试一试