delphi 获取当前系统版本号


本文整理自网络,侵删。

 
unit Unit1;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls;

type
  TForm1 = class(TForm)
    Memo1: TMemo;
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

function GetWindowsVersionString : AnsiString;

var

VI: TOSVersionInfoA;

begin

  VI.dwOSVersionInfoSize := SizeOf(TOSVersioninfoA);

  if GetVersionExA(VI) then

  with VI do

  Result := Trim (

  Format(

      '%d.%d build %d %s',

      [dwMajorVersion, dwMinorVersion,dwBuildNumber,szCSDVersion]

  )

  )



  else

  Result:= '';

end;

procedure TForm1.FormCreate(Sender: TObject);
begin
Showmessage(GetWindowsVersionString);
end;

end.

相关阅读 >>

Delphi 窗口全屏

Delphi 内存读取、修改

Delphi formatdatetime 显示日期时间

Delphi tscreen 类 - 通过 screen 更换光标

Delphi xe更改ttrayicon系统任务栏图标(无模糊)

Delphi 字符串与内存流和文件的快速转换函数

Delphi 使电脑睡眠代码

Delphi high 返回数组下标的最大值

Delphi整理二(object pascal语言)

Delphi rest/post

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...