H
hartlen
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure TForm1.Button1Click(Sender: TObject);
var
Reg : TRegistry;
Val : TStrings;
i : Integer;
InternalPatternVer : integer;
VsApiNTVer : string;
version : string;
begin
InternalPatternVer:=0;
VsApiNTVer:='';
Val:=TStringList.Create;
Reg:=TRegistry.Create;
Reg.RootKey:=HKEY_LOCAL_MACHINE;
try
if Reg.OpenKey('Software/TrendMicro/PC-cillinNTCorp/CurrentVersion/Misc.',False) then
begin
reg.GetValueNames(val);
if Val.Count>0 then
begin
InternalPatternVer:=0;
VsApiNTVer:='';
for i:=0 to Val.Count-1 do
begin
if Val.Strings='InternalPatternVer' then
begin
InternalPatternVer:=Reg.ReadInteger(Val.Strings);
end;
if Val.Strings='VsApiNT-Ver' then
begin
VsApiNTVer:= Reg.ReadString(Val.Strings);
end;
end;
end;
end;
finally
Reg.Free;
val.Free;
end;
if (VsApiNTVer<>'') and (InternalPatternVer<>0) then
begin
VsApiNTVer:=copy(VsApiNTVer,0,5);
showmessage(inttostr(InternalPatternVer))
[blue]//////显示是 280500[/blue] version:=[red]copy(inttostr(InternalPatternVer),0,1) +'.' +copy(inttostr(InternalPatternVer),1,3)+'.'+ copy(inttostr(InternalPatternVer),5,2)[/red];
showmessage(version)
//显示是2.280.00
end;
end;
var
Reg : TRegistry;
Val : TStrings;
i : Integer;
InternalPatternVer : integer;
VsApiNTVer : string;
version : string;
begin
InternalPatternVer:=0;
VsApiNTVer:='';
Val:=TStringList.Create;
Reg:=TRegistry.Create;
Reg.RootKey:=HKEY_LOCAL_MACHINE;
try
if Reg.OpenKey('Software/TrendMicro/PC-cillinNTCorp/CurrentVersion/Misc.',False) then
begin
reg.GetValueNames(val);
if Val.Count>0 then
begin
InternalPatternVer:=0;
VsApiNTVer:='';
for i:=0 to Val.Count-1 do
begin
if Val.Strings='InternalPatternVer' then
begin
InternalPatternVer:=Reg.ReadInteger(Val.Strings);
end;
if Val.Strings='VsApiNT-Ver' then
begin
VsApiNTVer:= Reg.ReadString(Val.Strings);
end;
end;
end;
end;
finally
Reg.Free;
val.Free;
end;
if (VsApiNTVer<>'') and (InternalPatternVer<>0) then
begin
VsApiNTVer:=copy(VsApiNTVer,0,5);
showmessage(inttostr(InternalPatternVer))
[blue]//////显示是 280500[/blue] version:=[red]copy(inttostr(InternalPatternVer),0,1) +'.' +copy(inttostr(InternalPatternVer),1,3)+'.'+ copy(inttostr(InternalPatternVer),5,2)[/red];
showmessage(version)
//显示是2.280.00
end;
end;