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 n个字符串替换成1个字符串

Delphi tms web core 从js调用pascal函数

Delphi tfinddialog treplacedialog对话框在memo中的使用

Delphi adotable1 链接mdb数据库

Delphi 打造mygetprocaddress函数(Delphi源码)

Delphi搜索字符串在流中的位置

Delphi 中 tjpegimage 中的一处问题修复

Delphi使用进行post数据时超时设置

Delphi android服务向导

Delphi10.3通过json.serializers单元对大量数据序列化

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



打赏

取消

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

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

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

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

评论

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