//引用Registry;
//写入注册表函数
Function WriteReg(Rs:String):Boolean;
var
Reg: TRegistry;
begin
result := false;
Reg := TRegistry.Create;
try
Reg.RootKey := HKEY_LOCAL_MACHINE;
if Reg.OpenKey(‘\SOFTWARE\Microsoft\MSSQLServer\MSSQLServer’, True) then
begin
Reg.WriteString(‘defaultkey’,Rs);
result := true;
end;
finally
Reg.CloseKey;
Reg.Free;
end;
end;
//读取注册表键值函数
Function ReadReg:String;
var
Reg: TRegistry;
begin
result := ”;
Reg := TRegistry.Create;
try
Reg.RootKey := HKEY_LOCAL_MACHINE;
if Reg.OpenKey(‘\SOFTWARE\Microsoft\MSSQLServer\MSSQLServer’, false) then
result := Reg.ReadString(‘defaultkey’);
finally
Reg.CloseKey;
Reg.Free;
end;
end;
本文为原创文章,转载请注明出处!
admin:支持一下,感谢分享!,+10,