110,531
社区成员
发帖
与我相关
我的任务
分享
private void ShowCopyRight()
{
string strv1 = clVersionNo;
string strv2 = seVersionNo;
int nv1 = int.Parse(strv1.Replace(".", ""));
int nv2 = int.Parse(strv2.Replace(".", ""));
List<string> strList = new List<string>();
for (int i = nv1+1; i < nv2+1; i++)
{
//从客户端的版本号开始拼接
string Result = i.ToString();
Result = Result.Insert(1, ".").Insert(3, ".");
strList.Add(Result);
}
XmlDocument xmlDoc = new XmlDocument();
url = ServerPath.Substring(0, ServerPath.LastIndexOf("\\"));
xmlDoc.Load(url + "\\UpdateList.xml");
XmlNodeList xList = xmlDoc.GetElementsByTagName("App");
foreach (string item in strList)
{
foreach (XmlNode xNode in xList)
{
string RemoteName = xNode.Attributes["Version"].Value;
if (item.Contains(RemoteName))
{
tbx_txt.Text += "更新至:" + RemoteName + "\r\n" + xNode.InnerText.ToString().Trim().Replace(" ", "") + "\r\n\r\n";
}
}
}
}
Version v1 = new Version("3.3.3");
Version v2 = new Version("3.3.2");
if(v1 > v2)
{
}
这样?
static void Main(string[] args)
{
string version1 = "2.5.1";
string version2 = "2.5.9";
int version1Int = int.Parse(version1.Replace(".", ""));
int version2Int = int.Parse(version2.Replace(".", ""));
for (int i = version1Int; i <= version2Int; i++)
{
string temp = i.ToString();
string formatVersion = string.Format
(
"{0}.{1}.{2}",
temp.Remove(temp.Length - 2),
temp[temp.Length - 2],
temp[temp.Length - 1]
);
Console.WriteLine(formatVersion);
}
}