且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

比较.NET框架中的两个数字字符串

更新时间:2023-11-05 13:05:22

检查这个 c# - 比较版本号 [ ^

I am making a windows based software I wanted to add version checker.
I try this ...But it can only compare two string like 1.3,2.1 etc etc... but when i do 2.1.1 it shows error. if my product version is 3.1.4 i cant also do that with this code. error shows. what can i do now

My Product Version Is : 3.1.4
And New Version is : 3.2.1
how to compare ?

What I have tried:

double num = 1.3;
     double dnum = 1.545;
     if (num > num)
          {
             MessageBox.Show("New Update Found");
          }
          else
          {
              MessageBox.Show("No new found");
          }

check this c# - Compare version numbers [^]