Пример #1
0
        private void Import_Click(object sender, EventArgs e)
        {
            OpenFileDialog dlg = new OpenFileDialog();

            dlg.InitialDirectory = System.Windows.Forms.Application.StartupPath;
            if (dlg.ShowDialog() == DialogResult.OK)
            {
                string        name = dlg.FileName;
                Configuration cfg  = Configuration.LoadFile(name);
                if (cfg.configs.Count == 1 && cfg.configs[0].server == Configuration.GetDefaultServer().server)
                {
                    MessageBox.Show("Load config file failed", "ShadowsocksR");
                }
                else
                {
                    controller.MergeConfiguration(cfg);
                    LoadCurrentConfiguration();
                }
            }
        }