Beispiel #1
0
 private void ResetDefaultsToolStripMenuItem_Click(object sender, EventArgs e)
 {
     File.Delete(VPNSettings.VPNListPath);
     VPNList = VPNSettings.LoadVPNEntries(VPNSettings.VPNListPath);
     reloadElements();
     MessageBox.Show("VPN List Configuration has been reset to default.", "Configuration", MessageBoxButtons.OK, MessageBoxIcon.Information);
 }
Beispiel #2
0
 private void Form1_Load(object sender, EventArgs e)
 {
     VPNList = VPNSettings.LoadVPNEntries(VPNSettings.VPNListPath);
     vpncon  = new VPNConnection();
     random  = new Random();
     button1.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Transparent;
     button1.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Transparent;
     UpdateElements();
 }
Beispiel #3
0
        private void LoadVPNListToolStripMenuItem_Click(object sender, EventArgs e)
        {
            using (OpenFileDialog openFileDialog = new OpenFileDialog())
            {
                openFileDialog.Filter           = "txt Files (*.txt)|*.txt";
                openFileDialog.FilterIndex      = 2;
                openFileDialog.RestoreDirectory = true;

                if (openFileDialog.ShowDialog() == DialogResult.OK)
                {
                    var tmplist = VPNSettings.LoadVPNEntries(openFileDialog.FileName);
                    var count   = tmplist.Count;

                    if (count > 0)
                    {
                        VPNList = tmplist;
                        reloadElements();
                    }
                    string tmpmsg = string.Format("Loaded {0} VPN Entries from file!", count);
                    MessageBox.Show(tmpmsg, "VPN List", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
        }