Example #1
0
        public static Form DecideForm()
        {
            var args = new List<string>(Environment.GetCommandLineArgs());

            // TODO.

            if (args.Contains(@"-i") || args.Count <= 1 && !Installer.IsInstalled)
            {
                return new InstallForm();
            }
            else if (args.Contains(@"-u") || args.Count <= 1 && Installer.IsInstalled)
            {
                return new UninstallForm();
            }
            else if (args.Contains(@"-b") && args.Count == 3)
            {
                var r = new BackupForm();
                r.Initialize(args[2]);
                return r;
            }
            else if (args.Contains(@"-r") && args.Count == 3)
            {
                var r = new RestoreForm();
                r.Initialize(args[2]);
                return r;
            }
            else
            {
                throw new Exception("Unknown/invalid command line arguments.");
            }
        }
Example #2
0
        private void 备份_Click(object sender, EventArgs e)
        {
            BackupForm backup = new BackupForm();

            backup.textBox2.Text = path;
            backup.ShowDialog();
        }