📄 clsuser.~pa
字号:
unit clsUser;
interface
uses
classes, SysUtils;
type
TclsUser = class(TObject)
private
PID: string;
PName: string;
PDesc: string;
PType: integer;
PExternal: integer;
PAID: string;
Pbuilder: string;
PbDate: string;
Previser: string;
PrDate: string;
PUserGroup: TStringList;
procedure SetPassword(const Value: string);
function GetPassword: string;
protected
PPassword: string;
public
property FID: string read PID write PID;
property FName: string read PName write PName;
property FDesc: string read PDesc write PDesc;
property FType: integer read PType write PType;
property FExternal: integer read PExternal write PExternal;
property FPassword: string read GetPassword write SetPassword;
property FAID: string read PAID write PAID;
property Fbuilder: string read Pbuilder write Pbuilder;
property FbDate: string read PbDate write PbDate;
property Freviser: string read Previser write Previser;
property FrDate: string read PrDate write PrDate;
function DeCrypt(AstrPassword: string): string;
function EnCrypt(AstrPassword: string): string;
end;
implementation
{ TclsUser }
function TclsUser.DeCrypt(AstrPassword: string): string;
var
lStrPas: string;
i: integer;
begin
lStrPas := ''; //秆盞
for i := Length(AstrPassword) downto 1 do
begin
lStrPas := lStrPas + chr(ord(AstrPassword[i]) - 1);
end;
result := lStrPas;
end;
function TclsUser.EnCrypt(AstrPassword: string): string;
var
lStrPas: string;
i: integer;
begin
lStrPas := '';
for i := Length(AstrPassword) downto 1 do
begin
if ord(AstrPassword[i]) > 127 then
raise exception.Create('The Password must be ASCII char!');
lStrPas := lStrPas + chr(ord(AstrPassword[i]) + 1);
end;
result := lStrPas;
end;
function TclsUser.GetPassword: string;
begin
result := DeCrypt(PPassword);
end;
procedure TclsUser.SetPassword(const Value: string);
begin
PPassword := EnCrypt(value);
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -