Beispiel #1
0
        private void MainForm_Shown(object sender, EventArgs e)
        {
            if (!AdminPrivilege.isElevated())
            {
                groupBox1.Enabled = false;
                MessageBox.Show("This application needs admin previlege to modify hosts.", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }

            if (Preferences.isExist())
            {
                textBox1.Text = Preferences.Get_StorageSize();
            }
            else
            {
                groupBox2.Enabled = false;
            }

            try
            {
                using (var client = new WebClient())
                {
                    client.DownloadFile(GITHUB_ADSLIST, FILE_ADSLIST);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Something went wrong...", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }