Delphi版本号检测判断


本文整理自网络,侵删。

 
uses
System.StrUtils, System.Types

function TFrmMain.CheckVersion(Ver1, Ver2: string): Boolean; //Ver1 网络版本, Ver2 本地版本
var
  v1, v2: TStringDynArray;
begin
//版本判断
  v1 := SplitString(Ver1, '.');
  v2 := SplitString(Ver2, '.');
  if (Length(v1) <> 4) or (Length(v2) <> 4) then
  begin
    Application.MessageBox('版本号错误,无法保证系统更新。', '版本号错误', MB_OK + MB_ICONSTOP);
  end
  else
  begin
      if v1[0] > v2[0] then
      begin
        Result := True;
        exit
      end
      else if v1[1] > v2[1] then
      begin
        Result := True;
        exit
      end
      else if v1[2] > v2[2] then
      begin
        Result := True;
        exit
      end
      else if v1[3] > v2[3] then
      begin
        Result := True;
        exit
      end
      else
      begin
        //版本已是最新
        Result := False;
      end;
  end;

end;

相关阅读 >>

Delphi 递归遍历treeview树节点

Delphi 消息实现窗口最小化,最大化,关闭(Delphi)

Delphi 自我拷贝复制

Delphi 取得当前监视器的分辨率

Delphi文件是否正在使用

Delphi incyear、incmonth、incweek、incday、inchour、incminute、incsecond、incmillisecond �c 增时

Delphi 删除internet临时文件

Delphi 隐藏进程的单元 unit hideprocess.pas

Delphi实时监视应用程序内存使用量

Delphi 禁止改变窗口大小和移动窗口

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



打赏

取消

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

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

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

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

评论

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