XDocument xmlDoc = XDocument.Load("http://www.xxx.com/xxx.xml");
if (Convert.ToDateTime(xmlDoc.Root.Element("checkDate").Value) > DateTime.Now)
{
if (xmlDoc.Root.Element("chukushenheVelcheck").Value != dgdsoft.version)
{
MessageBox.Show("您使用的软件版本不是最终版本,请联系开发者!");
this.Dispose();
}
else
{
menuStrip1.Enabled = false;
this.toolStripStatusLabel1.Text = dgdsoft.softname + " " + dgdsoft.module + " " + dgdsoft.version;
this.toolStripStatusLabel2.Text = dgdsoft.companyName;
changeTab(0);
this.MaximizeBox = false;
}
}
else
{
MessageBox.Show("软件测试使用期限已过,请联系开发者!");
this.Dispose();
}
需要引用:
using System.Xml;
using System.Xml.Linq;