コード例 #1
0
        internal static void CheckApplicationUpdate(string version, NotifyIcon notifyIcon)
        {
            var url = @"http://xupefei.github.io/Locale-Emulator/VersionInfo.xml";

            try
            {
                var client = new WebClientEx(10 * 1000);
                var stream = client.DownloadDataStream(url);

                var xmlContent = new XmlDocument();
                xmlContent.Load(stream);

                ProcessUpdate(xmlContent, notifyIcon);
            }
            catch (Exception)
            {
                notifyIcon.Visible = false;
                Environment.Exit(0);
            }
        }
コード例 #2
0
        internal static void CheckRegistryUpdate(int version, NotifyIcon notifyIcon)
        {
            var url = string.Format(@"http://service.watashi.me/le/registry.php?ver={0}&lang={1}",
                                    version,
                                    CultureInfo.CurrentUICulture.LCID);

            var registryPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location),
                                            "LERegistry.xml");

            try
            {
                var client = new WebClientEx(10 * 1000);
                client.DownloadFile(url, registryPath);
            }
            catch (Exception)
            {
                notifyIcon.Visible = false;
                Environment.Exit(0);
            }
        }
コード例 #3
0
        internal static void CheckApplicationUpdate(string version, NotifyIcon notifyIcon)
        {
            var url = string.Format(@"http://service.watashi.me/le/check.php?ver={0}&lang={1}",
                                    version,
                                    CultureInfo.CurrentUICulture.LCID);

            try
            {
                var client = new WebClientEx(10 * 1000);
                var stream = client.DownloadDataStream(url);

                var xmlContent = new XmlDocument();
                xmlContent.Load(stream);

                ProcessUpdate(xmlContent, notifyIcon);
            }
            catch (Exception)
            {
                notifyIcon.Visible = false;
                Environment.Exit(0);
            }
        }