private void Button1_Click(object sender, EventArgs e) { if (!string.IsNullOrWhiteSpace(textBox1.Text) && !string.IsNullOrWhiteSpace(textBox2.Text) && !string.IsNullOrWhiteSpace(textBox3.Text)) { string user = textBox1.Text, login = textBox2.Text, pass = textBox3.Text; if (textBox1.Text.Contains(' ')) { user = textBox1.Text.Replace(" ", ""); } if (textBox2.Text.Contains(' ')) { login = textBox2.Text.Replace(" ", ""); } if (textBox3.Text.Contains(' ')) { pass = textBox3.Text.Replace(" ", ""); } using (RegistryKey key = Registry.CurrentUser.CreateSubKey($@"Software\SteamProfiles\{login}")) { user = Encriptor.Encypter(user); login = Encriptor.Encypter(login); pass = Encriptor.Encypter(pass); key.SetValue("UserName", user); key.SetValue("Login", login); key.SetValue("Password", pass); } textBox1.Clear(); textBox2.Clear(); textBox3.Clear(); MessageBox.Show(Success); } else { MessageBox.Show(FieldsError); } }
private void Button1_Click(object sender, EventArgs e) { if (!string.IsNullOrWhiteSpace(textBox1.Text)) { if (!string.IsNullOrWhiteSpace(textBox2.Text) && string.IsNullOrWhiteSpace(textBox3.Text)) { using RegistryKey reg = Registry.CurrentUser.OpenSubKey($@"SOFTWARE\SteamProfiles\{textBox1.Text}", true); if (reg != null) { Registry.CurrentUser.OpenSubKey($@"SOFTWARE\SteamProfiles\{textBox1.Text}", true).SetValue("UserName", Encriptor.Encypter(textBox2.Text)); MessageBox.Show(Done); } } if (!string.IsNullOrWhiteSpace(textBox2.Text) && !string.IsNullOrWhiteSpace(textBox3.Text)) { using RegistryKey reg = Registry.CurrentUser.OpenSubKey($@"SOFTWARE\SteamProfiles\{textBox1.Text}", true); if (reg != null) { Registry.CurrentUser.OpenSubKey($@"SOFTWARE\SteamProfiles\{textBox2.Text}", true).SetValue("UserName", Encriptor.Encypter(textBox2.Text)); Registry.CurrentUser.OpenSubKey($@"SOFTWARE\SteamProfiles\{textBox2.Text}", true).SetValue("Password", Encriptor.Encypter(textBox3.Text)); MessageBox.Show(Done); } } if (!string.IsNullOrWhiteSpace(textBox3.Text) && string.IsNullOrWhiteSpace(textBox2.Text)) { using RegistryKey reg = Registry.CurrentUser.OpenSubKey($@"SOFTWARE\SteamProfiles\{textBox1.Text}", true); if (reg != null) { reg.SetValue("Password", Encriptor.Encypter(textBox3.Text)); MessageBox.Show(Done); } } } else { MessageBox.Show(LoginError); } }