private void SaveInfo() { // Save user email address FoeClientRegistry.SetEntry("useremail", tbxEmail.Text.Trim()); // Save SMTP Info FoeClientRegistry.SetEntry("smtpserver", tbxSmtpServer.Text.Trim().ToLower()); FoeClientRegistry.SetEntry("smtpport", tbxSmtpPort.Text.Trim()); FoeClientRegistry.SetEntry("smtpauthrequired", (cbxSmtpRequireAuth.Checked ? "T" : "F")); FoeClientRegistry.SetEntry("smtpsslenabled", (cbxSmtpRequireSsl.Checked ? "T" : "F")); FoeClientRegistry.SetEntry("smtpusername", tbxSmtpUsername.Text.Trim()); FoeClientRegistry.SetEntry("smtppassword", tbxSmtpPassword.Text); // Save POP3 info FoeClientRegistry.SetEntry("popserver", tbxPopServer.Text.Trim().ToLower()); FoeClientRegistry.SetEntry("popport", tbxPopPort.Text.Trim()); FoeClientRegistry.SetEntry("popsslenabled", (cbxPopRequireSsl.Checked ? "T" : "F")); FoeClientRegistry.SetEntry("popusername", tbxPopUsername.Text.Trim()); FoeClientRegistry.SetEntry("poppassword", tbxPopPassword.Text); }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); // Check if this is the first time setup is run. // If so, we'll display the legal notice. if (IsFirstRun()) { LegalNotice legalForm = new LegalNotice(); Application.Run(legalForm); if (legalForm.DialogResult == DialogResult.Cancel) { return; } } // Check if email is configured if (!IsEmailConfigured()) { Setup setupForm = new Setup(); Application.Run(setupForm); // Check the DialogResult for setupForm if (setupForm.DialogResult == DialogResult.Cancel) { MessageBox.Show("Please come back again when you have an email account ready."); return; } // Open the email information form EmailInfo emailInfoForm = new EmailInfo(); Application.Run(emailInfoForm); if (emailInfoForm.DialogResult == DialogResult.Cancel) { // User cancelled setup, exit program return; } } // Check if we need to register user if (!IsRegistered()) { Registration regForm = new Registration(); Application.Run(regForm); // Check if regForm returns OK if (regForm.DialogResult == DialogResult.Cancel) { // Exit program return; } } // Setup complete, set FirstRun to "F" (false) FoeClientRegistry.SetEntry("firstrun", "F"); // Start Foe client FoeReader foeReader = new FoeReader(); Application.Run(foeReader); }