发信人: mendy.bbs@bbs.nju.edu.cn (孟迪), 信区: cnprogram
标 题: How to get the windows and DOS versions
发信站: nju_bbs (Sun Apr 19 09:19:57 1998)
转信站: Lilac!ustcnews!nju_bbs
发信人: njhe (he要破产), 信区: RAD
标 题: How to get the windows and DOS versions.
发信站: '3m紫金飞鸿m' (Mon Mar 9 18:07:51 1998) , 站内信件
Product: Delphi
Version: 1.0
Platform: Windows
Q: How can I get the Windows or DOS version numbers?
A: The API call GetVersion will do it, but the information is
encrypted into a longint. Here is how to get and decrypt the information:
Type
TGetVer = record
WinVer,
WinRev,
DosRev,
DosVer: Byte;
end;
const
VerStr = '%d.%d';
procedure TForm1.Button1Click(Sender: TObject);
var
AllVersions: TGetVer;
begin
AllVersions := TGetVer(GetVersion);
Edit1.Text := Format(VerStr, [AllVersions.WinVer, AllVersions.WinRev]);
Edit2.Text := Format(VerStr, [AllVersions.DOSVer, AllVersions.DOSRev]);
end;
Note1: The values that windows displays for the versions and the values
that it returns through its API call are not always the same. e.g. The
workgroup version displays as 3.10 rather than 3.11.
Note2: Win32 applications should call GetVersionEx rather than GetVersion.
--
不惜一切代价,达到修炼的真义。
遇神阻则弑神,遇佛阻则弑佛。
m;31m※ 来源:·紫金飞鸿 bbs.njupt.edu.cn·[FROM: 202.119.236.104]m
--
※ 来源:.南大小百合信息交换站 bbs.nju.edu.cn.[FROM: a507yjh.nju.edu]
Powered by KBS BBS 2.0 (http://dev.kcn.cn)
页面执行时间:2.141毫秒