Click here to Skip to main content
15,914,500 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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");
          }
Posted
Updated 5-Mar-17 2:08am
Comments
[no name] 5-Mar-17 7:36am    
https://msdn.microsoft.com/en-us/library/system.version(v=vs.110).aspx
Member 13003138 5-Mar-17 11:18am    
Thanks for answer with link :)
Afzaal Ahmad Zeeshan 5-Mar-17 8:13am    
I wonder if you can ever parse a version value to a double value.
Richard MacCutchan 5-Mar-17 8:43am    
Do not use double or float types for anything other than complex mathematics/statistics.
Member 13003138 5-Mar-17 11:18am    
thanks for answer :)

1 solution

 
Share this answer
 
Comments
Member 13003138 5-Mar-17 11:17am    
Thank you so much :)
Karthik_Mahalingam 5-Mar-17 11:18am    
welcome :)
Maciej Los 5-Mar-17 15:00pm    
5ed!
Karthik_Mahalingam 5-Mar-17 22:21pm    
Thank you Maciej Los >

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900