Skip to content

Commit

Permalink
v1.2 update
Browse files Browse the repository at this point in the history
  • Loading branch information
GMYXDS committed Nov 1, 2022
1 parent b7a264f commit 4f657e9
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 35 deletions.
5 changes: 1 addition & 4 deletions MstscManager/Controls/Change_pass.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@ public Change_pass() {
}

private void uiButton1_Click(object sender, EventArgs e) {
//RegistryKey rkey = Registry.CurrentUser;
//RegistryKey key = rkey.CreateSubKey(@"SOFTWARE\MstscManager");
//key = rkey.OpenSubKey(@"SOFTWARE\MstscManager",true);
//string password = key.GetValue("mstsc_pass","").ToString();

string? password = DbInihelper.GetIniData(Share.iniconfig_action, "mstsc_pass", Share.iniconfig_path);
if (password == "" || password == null) { ShowErrorTip("密码为空不能修改");return; }
string old_pass = uiTextBox1.Text;
Expand Down
15 changes: 0 additions & 15 deletions MstscManager/Controls/Common_setting.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,15 @@ public Common_setting() {
}

private void uiCheckBox1_CheckedChanged(object sender, EventArgs e) {
//RegistryKey rkey = Registry.CurrentUser;
//RegistryKey key = rkey.CreateSubKey(@"SOFTWARE\MstscManager");
//key = rkey.OpenSubKey(@"SOFTWARE\MstscManager", true);
if ((sender as UICheckBox).Checked) {
//to do 设置启动true;
//key.SetValue("is_open_with_mm", "1");
DbInihelper.SetIniData(Share.iniconfig_action, "is_open_with_mm", "1", Share.iniconfig_path);
Share.fm.set_mm_status("1");
} else {
//to do 设置启动false;
//key.SetValue("is_open_with_mm", "0");
DbInihelper.SetIniData(Share.iniconfig_action, "is_open_with_mm", "0", Share.iniconfig_path);
Share.fm.set_mm_status("0");
}
//key.Close();
//rkey.Close();
}

private void Common_setting_Load(object sender, EventArgs e) {
Expand All @@ -42,14 +35,6 @@ private void uiButton1_Click(object sender, EventArgs e) {
new_db_path = new_db_path.Replace(System.Environment.CurrentDirectory + "\\", "");
//File.Move(old_path, new_db_path);
File.Copy(old_path, new_db_path);
//common_tools.RunApp2("explorer.exe", " "+ dir);
//common_tools.RunApp2("explorer.exe", " " + Path.GetDirectoryName(old_path));
//RegistryKey rkey = Registry.CurrentUser;
//RegistryKey key = rkey.CreateSubKey(@"SOFTWARE\MstscManager");
//key = rkey.OpenSubKey(@"SOFTWARE\MstscManager", true);
//key.SetValue("db_path", new_db_path);
//key.SetValue("old_db_path", old_path);
//key.Close();rkey.Close();
DbInihelper.SetIniData(Share.iniconfig_action, "db_path", new_db_path, Share.iniconfig_path);
DbInihelper.SetIniData(Share.iniconfig_action, "old_db_path", old_path, Share.iniconfig_path);
Share.fm.set_db_path(new_db_path);
Expand Down
17 changes: 1 addition & 16 deletions MstscManager/FMain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,6 @@ private void check() {
//注册表拿到是否需要开启输入密码配置
//注册表拿密码
//注册表拿sql位置
//RegistryKey rkey = Registry.CurrentUser;
//RegistryKey key = rkey.CreateSubKey(@"SOFTWARE\MstscManager");
//key = rkey.OpenSubKey(@"SOFTWARE\MstscManager", true);
//is_open_with_mm = key.GetValue("is_open_with_mm", "-1").ToString();
//string mstsc_pass_s = key.GetValue("mstsc_pass", "-1").ToString();
//string db_path_s = key.GetValue("db_path", "-1").ToString();
//string old_db_path_s = key.GetValue("old_db_path", "-1").ToString();
//save_height = key.GetValue("save_height", "").ToString();
//save_width = key.GetValue("save_width", "").ToString();
//v1.2 改用iniconfig
Dictionary<string, string>? dict = DbInihelper.GetIniSection(iniconfig_action, iniconfig_path);
if (dict == null) dict = new Dictionary<string, string>();
Expand Down Expand Up @@ -1243,13 +1234,7 @@ private void FMain_FormClosing(object sender, FormClosingEventArgs e) {
save_width = this.ClientSize.Width.ToString();
save_height = this.ClientSize.Height.ToString();
}
//RegistryKey rkey = Registry.CurrentUser;
//RegistryKey key = rkey.CreateSubKey(@"SOFTWARE\MstscManager");
//key = rkey.OpenSubKey(@"SOFTWARE\MstscManager", true);
//key.SetValue("save_width", save_width);
//key.SetValue("save_height", save_height);
//key.Close();
//rkey.Close();

DbInihelper.SetIniData(iniconfig_action, "save_width", save_width, iniconfig_path);
DbInihelper.SetIniData(iniconfig_action, "save_height", save_height, iniconfig_path);
if (is_hide_behind == "1") {
Expand Down

0 comments on commit 4f657e9

Please sign in to comment.