コード例 #1
0
ファイル: RegisterFrom.cs プロジェクト: zjbdiy/test
        private void button1_Click(object sender, EventArgs e)
        {
            //校验原始字符串

            var key = PFunc.GetCheckStr();


            if (PFunc.GetKey(textBox2.Text) == key)
            {
                Configuration configuration = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
                configuration.AppSettings.Settings["Reg"].Value = textBox2.Text;
                configuration.Save(ConfigurationSaveMode.Modified);
                DialogResult = DialogResult.OK;
                Close();
                return;
            }

            MessageBox.Show(@"输入信息有误,请联系管理员");
        }
コード例 #2
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            //判断注册
            var key = PFunc.GetCheckStr();

            var value = ConfigurationManager.AppSettings["Reg"];

            if (PFunc.GetKey(value) != key)
            {
                var f = new RegisterFrom();
                f.ShowDialog();
                if (f.DialogResult != DialogResult.OK)
                {
                    Application.Exit();
                    return;
                }
            }

            Application.Run(new SerialForm());
        }
コード例 #3
0
 private void button2_Click(object sender, EventArgs e)
 {
     textBox2.Text = PFunc.GetKey(textBox3.Text);
 }