private void step4_Next_Click(object sender, EventArgs e) { step4_Next.Enabled = false; step4_Prev.Enabled = false; Finish.Enabled = true; Settings setting = Settings.Current; setting.SetupMode = newInstall.Checked == true ? SetupMode.New : SetupMode.Update; if (webSite.Text.Trim() == "") { MessageBox.Show("网站名称不能为空", "bbsMax安装向导", MessageBoxButtons.OK, MessageBoxIcon.Warning); step4_Next.Enabled = true; step4_Prev.Enabled = true; webSite.Focus(); } else if (webUrl.Text.Trim() == "") { MessageBox.Show("网站URL不能为空", "bbsMax安装向导", MessageBoxButtons.OK, MessageBoxIcon.Warning); step4_Next.Enabled = true; step4_Prev.Enabled = true; webUrl.Focus(); } else if (bbsName.Text.Trim() == "") { MessageBox.Show("论坛名称不能为空", "bbsMax安装向导", MessageBoxButtons.OK, MessageBoxIcon.Warning); step4_Next.Enabled = true; step4_Prev.Enabled = true; bbsName.Focus(); } else if (bbsUrl.Text.Trim() == "") { MessageBox.Show("论坛URL不能为空", "bbsMax安装向导", MessageBoxButtons.OK, MessageBoxIcon.Warning); step4_Next.Enabled = true; step4_Prev.Enabled = true; bbsUrl.Focus(); } else if (adminName.Text.Trim() == "") { MessageBox.Show("管理员不能为空", "bbsMax安装向导", MessageBoxButtons.OK, MessageBoxIcon.Warning); step4_Next.Enabled = true; step4_Prev.Enabled = true; adminName.Focus(); } else if (adminName.Text.Trim() == "") { MessageBox.Show("管理员帐号不能为空", "bbsMax安装向导", MessageBoxButtons.OK, MessageBoxIcon.Warning); step4_Next.Enabled = true; step4_Prev.Enabled = true; adminName.Focus(); } else if (adminNickName.Text.Trim() == "") { MessageBox.Show("管理员昵称不能为空", "bbsMax安装向导", MessageBoxButtons.OK, MessageBoxIcon.Warning); step4_Next.Enabled = true; step4_Prev.Enabled = true; adminNickName.Focus(); } else if (adminPwd.Text.Trim() == "" && newInstall.Checked == true) { MessageBox.Show("管理员密码不能为空", "bbsMax安装向导", MessageBoxButtons.OK, MessageBoxIcon.Warning); step4_Next.Enabled = true; step4_Prev.Enabled = true; adminPwd.Focus(); } else { setting.BBSName = bbsName.Text.Trim(); //setting.BBSUrl = bbsUrl.Text.Trim(); setting.SiteName = webSite.Text.Trim(); setting.SiteUrl = webUrl.Text.Trim(); setting.AdminName = adminName.Text.Trim(); //setting.AdminNickName = adminNickName.Text.Trim(); setting.AdminPassword = FormsAuthentication.HashPasswordForStoringInConfigFile(adminPwd.Text.Trim(), "MD5"); if (!setting.IsThreadAlive) { installWaiter = new InstallWaiter(this); installWaiter.InstallBarEvent += InstallBar; InstallThread = new Thread(new ThreadStart(Setup)); setting.IsThreadAlive = true; InstallThread.IsBackground = true; InstallThread.Start(); } this.tabControl1.SelectedIndex = 4; } }