public Form1()
{
InitializeComponent();
try
{
// backup hosts
if (File.Exists(etc + "hosts") && Settings.Default.firstrun == false || !File.Exists(etc + "hosts.bak"))
{
File.Copy(etc + "hosts", etc + "hosts.bak", true);
Settings.Default.firstrun = true;
Settings.Default.Save();
}
}
catch (Exception ex)
{
textBox1.ForeColor = Color.Red;
textBox1.Text = textBox1.Text + "\r\nWARNING: " + Convert.ToString(ex);
textBox1.Text = textBox1.Text + "\r\nNo changes to your system have been made.";
progressBar1.Value = 0;
button1.Enabled = true;
button2.Enabled = true;
}
}