今天遇到这个问题,记录一下。

要自己写是个比较麻烦的事,.Net系统提供了Version类来解决这个问题。使用示范:

use System.Version:
 
string s1 ="001.001.002", s2 = "001.001.001";
Version v1 = new Version(s1), v2 = new Version(s2);
if (v1 > v2)
MessageBox.Show("Yes");

 

参考MSDN: http://msdn.microsoft.com/en-us/library/system.version.aspx

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-01-19
  • 2022-12-23
  • 2021-08-18
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-12-16
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案