Exemple #1
0
		private void DownloadVersionfile() {
			string fileUrl = Path.Combine(mUrl, VersionFileName);
			if (DownloadFile(fileUrl, VersionFilePath) == true) {
				XmlSerializer xml = new XmlSerializer(typeof(SVersionFile));
				using (FileStream fs = File.OpenRead(VersionFilePath))
					mVersionFile = xml.Deserialize(fs) as SVersionFile;

				return;
			}

			mVersionFile = null;
		}
        private void DownloadVersionfile()
        {
            string fileUrl = Path.Combine(mUrl, VersionFileName);

            if (DownloadFile(fileUrl, VersionFilePath) == true)
            {
                XmlSerializer xml = new XmlSerializer(typeof(SVersionFile));
                using (FileStream fs = File.OpenRead(VersionFilePath))
                    mVersionFile = xml.Deserialize(fs) as SVersionFile;

                return;
            }

            mVersionFile = null;
        }
Exemple #3
0
		private void frmMain_Load(object sender, EventArgs e) {
			if (File.Exists(UpdateHandler.VersionFileName) == false) {
				MessageBox.Show("Cant find VersionFile!\nCancel Updating...", "Update error", MessageBoxButtons.OK, MessageBoxIcon.Error);
				Close();
				return;
			}

			XmlSerializer xml = new XmlSerializer(typeof(SVersionFile));
			using (FileStream fs = File.OpenRead(UpdateHandler.VersionFileName)) {
				mVersionFile = xml.Deserialize(fs) as SVersionFile;
			}

			Text += mVersionFile.ApplicationName;
			StatusRtb.Text += "Initialize Update...\n";
			mBackgroundWorker.RunWorkerAsync();
		}