static void Main() { Process[] processes = System.Diagnostics.Process.GetProcessesByName(System.Diagnostics.Process.GetCurrentProcess().ProcessName); if (processes.Length > 1) { MessageBox.Show("Pandora已启动!请勿多次启动!"); System.Environment.Exit(1); } else { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); string path = AppDomain.CurrentDomain.SetupInformation.ApplicationBase; Config.path = path; //读取Pandora配置 Util.getPandoraCache(); //判断用户状态 if (Config.uid == null || "".Equals(Config.uid.Trim()) || "0".Equals(Config.uid.Trim())) { Initialize register = new Initialize(); register.Show(); } else { Login login = new Login(); login.Show(); } Application.Run(); } }
private void reset_label_Click(object sender, EventArgs e) { DialogResult dr = MessageBox.Show("请注意!重置系统后,原接收消息及绑定信息将全部重置!", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question); if (dr == DialogResult.OK) { DialogResult drr = MessageBox.Show("请再次确认!确定重置系统?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question); if (drr == DialogResult.OK) { Util.initPandoraCache(); Config.uid = null; Config.pri_key = ""; Config.pri_key_des = ""; Config.pub_key = ""; Config.security_id = ""; Initialize init = new Initialize(); init.Show(); this.Dispose(); } } }