日期:2014-05-17  浏览次数:20946 次

怎么比较x.x.x与x.x.x的值
比如2.5.1和3.4.9怎么比较他们,分不多了只有这么点了

------解决方案--------------------

            string strv1 = "2.5.1";
            string strv2 = "2.6.0";
            int nv1 = int.Parse(strv1.Replace(".", ""));
            int nv2 = int.Parse(strv2.Replace(".", ""));

            List<string> strList = new List<string>();
            for (int m = nv1 + 1; m < nv2; m++)
            {
                //拼接2.5.2
                string Result = m.ToString();
                Result = Result.Insert(1, ".").Insert(3,".");

                strList.Add(Result);
            }