コード例 #1
0
        public static bool CheckForUpdate(bool notify)
        {
            try
            {
                string tempfile = System.IO.Path.GetTempFileName();
                using (WebClient client = new WebClient())
                {
                    client.DownloadFile("http://digicamcontrol.com/updates/versioninfo.xml", tempfile);
                }

                XmlDocument document = new XmlDocument();
                document.Load(tempfile);
                string ver              = document.SelectSingleNode("application/version").InnerText;
                string url              = "http://digicamcontrol.com/download";
                string logurl           = "";
                var    selectSingleNode = document.SelectSingleNode("application/url");
                if (selectSingleNode != null)
                {
                    url = selectSingleNode.InnerText;
                }
                var logNode = document.SelectSingleNode("application/logurl");
                if (logNode != null)
                {
                    logurl = logNode.InnerText;
                }
                Version v_ver = new Version(ver);
                if (v_ver > Assembly.GetExecutingAssembly().GetName().Version)
                {
                    var wnd = new NewVersionWnd(logurl, url);
                    wnd.ShowDialog();
                }
                else
                {
                    if (notify)
                    {
                        MessageBox.Show(TranslationStrings.MsgApplicationUpToDate);
                    }
                }
                File.Delete(tempfile);
            }
            catch (Exception exception)
            {
                Log.Error("Error download update information", exception);
            }
            return(false);
        }
コード例 #2
0
        public static bool CheckForUpdate(bool notify)
        {
            try
            {
                string tempfile = System.IO.Path.GetTempFileName();
                using (WebClient client = new WebClient())
                {
                    client.DownloadFile("http://digicamcontrol.com/updates/versioninfo.xml", tempfile);
                }

                XmlDocument document = new XmlDocument();
                document.Load(tempfile);
                string ver = document.SelectSingleNode("application/version").InnerText;
                string url = "http://digicamcontrol.com/download";
                string logurl = "";
                var selectSingleNode = document.SelectSingleNode("application/url");
                if (selectSingleNode != null)
                    url = selectSingleNode.InnerText;
                var logNode = document.SelectSingleNode("application/logurl");
                if (logNode != null)
                    logurl = logNode.InnerText;
                Version v_ver = new Version(ver);
                if (v_ver > Assembly.GetExecutingAssembly().GetName().Version)
                {
                    var wnd = new NewVersionWnd(logurl, url);
                    wnd.ShowDialog();
                }
                else
                {
                    if (notify)
                        MessageBox.Show(TranslationStrings.MsgApplicationUpToDate);
                }
                File.Delete(tempfile);
            }
            catch (Exception exception)
            {
                Log.Error("Error download update information", exception);
            }
            return false;
        }
コード例 #3
0
 public static void ShowChangeLog()
 {
     var wnd = new NewVersionWnd("http://digicamcontrol.com/updates/changelog.html", "");
     wnd.ShowDialog();
 }
コード例 #4
0
        public static void ShowChangeLog()
        {
            var wnd = new NewVersionWnd("http://digicamcontrol.com/updates/changelog.html", "");

            wnd.ShowDialog();
        }