private void Locker_Load(object sender, EventArgs e) { System.Windows.Forms.Cursor.Hide(); //隐藏鼠标 if (PublicClass.AuroraMain.WindowState != FormWindowState.Minimized) { this.Location = new Point(PublicClass.AuroraMain.Location.X, PublicClass.AuroraMain.Location.Y); this.Height = PublicClass.AuroraMain.Height; this.Width = PublicClass.AuroraMain.Width; } else { this.WindowState = FormWindowState.Minimized; } //是否全屏运行Locker RegistryKey MyReg, RegFullScreen; MyReg = Registry.CurrentUser; try { RegFullScreen = MyReg.CreateSubKey("Software\\Aurora\\Locker"); if (RegFullScreen.GetValue("FullScreen").ToString() == "YES") { this.FormBorderStyle = FormBorderStyle.None; this.WindowState = FormWindowState.Maximized; this.TopMost = true; } } catch { } }
private void Setting_Load(object sender, EventArgs e) { label8.Visible = false; label9.Visible = false; textBox5.Visible = false; //默认数据保护锁的时间文本框不可见。 checkBox4.Visible = false; RegistryKey MyReg, RegProjectInfo; //声明注册表对象 MyReg = Registry.CurrentUser; //获取当前用户注册表项 try { RegProjectInfo = MyReg.CreateSubKey("Software\\Aurora\\ProjectInfo");//在注册表项中创建子项 this.textBox1.Text = (RegProjectInfo.GetValue("ProjectName")).ToString(); this.textBox2.Text = (RegProjectInfo.GetValue("Calculator")).ToString(); this.textBox3.Text = (RegProjectInfo.GetValue("Checker")).ToString(); this.textBox4.Text = (RegProjectInfo.GetValue("MyGrade")).ToString(); } catch { } RegistryKey MyReg1, RegLocker; //声明注册表对象 MyReg1 = Registry.CurrentUser; //获取当前用户注册表项 try { RegLocker = MyReg.CreateSubKey("Software\\Aurora\\Locker");//在注册表项中创建子项 if ((RegLocker.GetValue("Enabled")).ToString() == "1") { checkBox1.Checked = true; } this.textBox5.Text = (RegLocker.GetValue("Timer")).ToString(); } catch { } //全屏保护提示 RegistryKey RegFullScreen; try { RegFullScreen = MyReg.CreateSubKey("Software\\Aurora\\Locker"); if (RegFullScreen.GetValue("FullScreen").ToString() == "YES") { checkBox4.Checked = true; } else { checkBox4.Checked = false; } } catch { } //读取单元格颜色 RegistryKey RegColor; //声明注册表对象 MyReg = Registry.CurrentUser; //获取当前用户注册表项 try { RegColor = MyReg.CreateSubKey("Software\\Aurora\\Color"); //在注册表项中创建子项 pictureBox1.BackColor = ColorTranslator.FromHtml(RegColor.GetValue("CellColor").ToString()); //显示注册表的位置 } catch { } //显示桌面提示 RegistryKey RegReminder; try { RegReminder = MyReg.CreateSubKey("Software\\Aurora\\Reminder"); if (RegReminder.GetValue("ShowDesktopReminder").ToString() == "YES") { checkBox3.Checked = true; } else { checkBox3.Checked = false; } } catch { } //退出提示 try { RegReminder = MyReg.CreateSubKey("Software\\Aurora\\Reminder"); if (RegReminder.GetValue("ExitReminder").ToString() == "YES") { checkBox2.Checked = true; } else { checkBox2.Checked = false; } } catch { } }