初始化版本
This commit is contained in:
55
SLC1-N/UserPassword.cs
Normal file
55
SLC1-N/UserPassword.cs
Normal file
@@ -0,0 +1,55 @@
|
||||
using Microsoft.Win32;
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace SLC1_N
|
||||
{
|
||||
public partial class UserPassword : Form
|
||||
{
|
||||
public UserPassword()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void UserPassword_Load(object sender, EventArgs e)
|
||||
{
|
||||
New_Pwd1.Focus();
|
||||
}
|
||||
|
||||
private void Modify_pwd_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (New_Pwd1.Text == New_Pwd2.Text)
|
||||
{
|
||||
SetParameters();
|
||||
this.Close();
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show("两次输入的密码不一致!");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//写入注册表内容
|
||||
private void SetParameters()
|
||||
{
|
||||
|
||||
RegistryKey regName;
|
||||
|
||||
regName = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\PMD\\1.0\\User-LL28-Set", true);
|
||||
|
||||
if (regName is null)
|
||||
{
|
||||
regName = Registry.CurrentUser.CreateSubKey("SOFTWARE\\Microsoft\\PMD\\1.0\\User-LL28-Set");
|
||||
}
|
||||
|
||||
regName.SetValue("log_pwd", New_Pwd1.Text);
|
||||
|
||||
|
||||
|
||||
regName.Close();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user