private void pb_tuichu_Click(object sender, EventArgs e) { this.Hide(); WinFormdenglu mywin = new WinFormdenglu(); ////自动登录设置为false Settings.Default.zidongdenglu = false; mywin.StartPosition = FormStartPosition.CenterParent; if (mywin.ShowDialog() == DialogResult.OK) { JJLoginInfo.GetLoginInfo(JJLoginInfo._huaming); lbl_woderenwu_Click(lbl_wodezhuye, null); this.Show(); } ; ////清空panel //panel_my.Controls.Clear(); ////回退到登陆界面 //this.splitContainer1.Panel1Collapsed = true; //this.Width = 1000; //this.Height = 625; //UCdenglu ucdenglu = new UCdenglu(); //ucdenglu.Dock = DockStyle.Fill; //panel_my.Controls.Add(ucdenglu); }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); //先弹出登录窗体,如果成功返回dialogresult.ok WinFormdenglu mywin = new WinFormdenglu(); if (mywin.ShowDialog() == DialogResult.OK) { Application.Run(new Form1()); } }
private void lbl_tuichu_Click(object sender, EventArgs e) { //关闭当前窗体,显示登录窗体,另自动登录的setting为false this.Hide(); //this.Close(); Properties.Settings.Default.zidongdenglu = false; WinFormdenglu mywin = new WinFormdenglu(); if (mywin.ShowDialog() == DialogResult.OK) { (new Form1()).Show(); } }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); //判断是否存在新版本,如果不存在,直接登录,如果存在,显示正在下载框 //先下载软件新版本 //获得数据库最新软件的版本 MySQLHelper _mysql = new MySQLHelper(); string str_sql = $"select * from jjdbrenwutaizhang.附件信息表 " + $"where 类型='系统'"; var mydr = _mysql.ExecuteDataRow(str_sql); string newversion = mydr["文件名"].ToString(); if (newversion != JJSystemInfo._version) { //升级程序位置 string fileupdate = Application.StartupPath + $"\\update\\UpdateOA.exe"; //打开更新程序 System.Diagnostics.Process.Start(fileupdate); //杀掉自身程序 System.Diagnostics.Process[] proc = System.Diagnostics.Process.GetProcessesByName("团队任务台账管理系统"); foreach (System.Diagnostics.Process pro in proc) { pro.Kill(); } } //先弹出登录窗体,如果成功返回dialogresult.ok WinFormdenglu mywin = new WinFormdenglu() { TopLevel = true }; if (mywin.ShowDialog() == DialogResult.OK) { JJLoginInfo._huaming = mywin._huaming; //JJLoginInfo.GetLoginInfo(JJLoginInfo._huaming); Form1 myform1 = new Form1(); //判断登录权限,如果没有权限就要退出本方法 if (JJLoginInfo._denlguquan == 0) { MessageBox.Show("对不起,您暂无权限使用该系统!"); return; } Application.Run(myform1); } }