private void Button2_Click(object sender, EventArgs e) { if (checkBox1.Checked == true) { if (!Directory.Exists(Environment.SpecialFolder.ApplicationData.ToString())) { Directory.CreateDirectory(Environment.SpecialFolder.ApplicationData.ToString()); } if (File.Exists(Environment.SpecialFolder.ApplicationData.ToString() + "\\road.txt")) { File.Delete(Environment.SpecialFolder.ApplicationData.ToString() + "\\road.txt"); } File.WriteAllText(Environment.SpecialFolder.ApplicationData.ToString() + "\\road.txt", textBox1.Text); } this.DialogResult = DialogResult.OK; if (Directory.Exists(textBox1.Text)) { VideoBrowser vb = new VideoBrowser(); this.Hide(); vb.repository = textBox1.Text; vb.ShowDialog(); if (Program.closeall) { this.Close(); return; } this.Show(); } else { MessageBox.Show("Repository does not exist", "Cannot continue", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
static void Main(string[] args) { Application.SetCompatibleTextRenderingDefault(false); vb = new VideoBrowser(); f1 = new Form1(); Application.EnableVisualStyles(); if (args.Length > 0) { f1.textBox1.Text = string.Join(" ", args); } Application.Run(f1); }