diff --git a/net.nutcore.aliddns/net.nutcore.aliddns/Form_About.cs b/net.nutcore.aliddns/net.nutcore.aliddns/Form_About.cs index 86654e0..0448556 100644 --- a/net.nutcore.aliddns/net.nutcore.aliddns/Form_About.cs +++ b/net.nutcore.aliddns/net.nutcore.aliddns/Form_About.cs @@ -3,6 +3,7 @@ using System.Text; using System.IO; using System.Windows.Forms; using System.Xml; +using System.Net; namespace net.nutcore.aliddns { @@ -14,8 +15,19 @@ namespace net.nutcore.aliddns InitializeComponent(); this.MinimizeBox = false; //取消窗口最小化按钮 this.MaximizeBox = false; //取消窗口最大化按钮 + label_currentVer.Text = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString(); //获取当前版本 if (mainForm.checkUpdate == true) + { checkBox_autoCheckUpdate.Checked = true; + //获取远程版本信息 + /* + string strUrl = "https://api.github.com/respo/wisdomwei201804/AliDDNS/releases/latest"; //从控件获取WAN口IP查询网址,默认值为:"http://whatismyip.akamai.com/"; + Uri uri = new Uri(strUrl); + WebRequest webreq = WebRequest.Create(uri); + Stream s = webreq.GetResponse().GetResponseStream(); + StreamReader sr = new StreamReader(s, Encoding.Default); + string all = sr.ReadToEnd();*/ + } else checkBox_autoCheckUpdate.Checked = false; textBox_updateInfo.ReadOnly = true; string filePath = System.AppDomain.CurrentDomain.BaseDirectory; diff --git a/net.nutcore.aliddns/net.nutcore.aliddns/main.cs b/net.nutcore.aliddns/net.nutcore.aliddns/main.cs index 6c6c0b9..bba48bd 100644 --- a/net.nutcore.aliddns/net.nutcore.aliddns/main.cs +++ b/net.nutcore.aliddns/net.nutcore.aliddns/main.cs @@ -96,13 +96,13 @@ namespace net.nutcore.aliddns string update = ExePath + "update.exe"; if(checkUpdate == true) { - if (!File.Exists(update)) + if (File.Exists(update)) { - textBox_log.AppendText(System.DateTime.Now.ToString() + " " + "版本检测程序update.exe未找到,跳过版本检测! " + "\r\n"); + //执行update.exe } else { - //执行update.exe + textBox_log.AppendText(System.DateTime.Now.ToString() + " " + "版本检测程序update.exe未找到,跳过版本检测! " + "\r\n"); } } @@ -288,6 +288,13 @@ namespace net.nutcore.aliddns textWriter.WriteString(textBox_TTL.Text); textWriter.WriteEndElement(); + textWriter.WriteStartElement("autoCheckUpdate", ""); + if (checkUpdate == false) + textWriter.WriteString("Off"); + else + textWriter.WriteString("On"); + textWriter.WriteEndElement(); + textWriter.WriteEndElement(); //设置项目结束 textWriter.WriteEndDocument();//文档结束 textWriter.Close(); //文档保存关闭