📄 un_sysini.~pas
字号:
unit Un_SysIni;
interface
uses
classes, Registry, Publics, windows;
type
TSystemRegister=class
private
FRegistry: TRegistry;
public
constructor Create;
destructor Destroy; override;
procedure RegisteLastLoginUser(LoginUser: string);
function GetLastLoginUser: string;
end;
implementation
{ TSystemRegister }
constructor TSystemRegister.Create;
begin
FRegistry:= TRegistry.Create;
FRegistry.RootKey := HKEY_CURRENT_USER;
end;
destructor TSystemRegister.Destroy;
begin
FRegistry.Free;
inherited;
end;
function TSystemRegister.GetLastLoginUser: string;
begin
with FRegistry do
if OpenKey(MySoftKey, False) then
Result:= ReadString('LastLoginUser');
end;
procedure TSystemRegister.RegisteLastLoginUser(LoginUser: string);
begin
with FRegistry do begin
OpenKey(MySoftKey, True);
WriteString('LastLoginUser', LoginUser);
end;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -