sysset.cs

来自「学生学籍管理系统 学生管理 教材管理 成绩管理」· CS 代码 · 共 77 行

CS
77
字号
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Microsoft.Win32;

namespace 学籍管理系统
{
    public partial class sysset : DevComponents .DotNetBar .Office2007Form 
    {
        public sysset()
        {
            InitializeComponent();
        }

        private void buttonX1_Click(object sender, EventArgs e)
        {
            string my=null ;
            if (checkBoxX1.Checked == true)
            {
                my="max";
            }
            else if (checkBoxX1.Checked == false)
            {
                my = "nor"; ;
            }

            RegistryKey hklm = Registry.LocalMachine;
            RegistryKey xjgl = hklm.CreateSubKey(@"SOFTWARE\学籍管理系统");
            try
            {
                xjgl.SetValue("MyView", my);
            }
            catch (Exception)
            {
                MessageBox.Show ("系统配置错误!");
            }
            finally
            {
                hklm.Close();
                
            }
            this.Close();
        }

        private void buttonX2_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void sysset_Load(object sender, EventArgs e)
        {
            RegistryKey hkml = Registry.LocalMachine;
            RegistryKey xsxj = hkml.CreateSubKey(@"SOFTWARE\学籍管理系统");
            try
            {
                string my = xsxj.GetValue("MyView", "nor").ToString();
                if (my == "nor")
                {
                    checkBoxX1.Checked = false;
                }
                else
                {
                    checkBoxX1.Checked = true;
                }

            }
            finally
            {
                hkml.Close();
            }
        }
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?