private void button_Chenge_Click(object sender, EventArgs e) { String steam_user = comboBox_Account.SelectedItem.ToString(); Console.WriteLine(comboBox_Account.SelectedItem.ToString()); if (!steam_user.Equals("") && steam_user != null) { if (Class_utils.check_process()) { Class_utils.killProcess(); } string strKeyName = string.Empty; string softPath = @"SOFTWARE\Valve\Steam\"; RegistryKey regKey = Registry.CurrentUser; RegistryKey regSubKey = regKey.OpenSubKey(softPath, true); regSubKey.SetValue(@"AutoLoginUser", steam_user); Process app = Process.Start(textBox_SteamPath.Text + @"\steam.exe"); } else { MessageBox.Show("Can't find steam account"); } }
private void MainForm_Load(object sender, EventArgs e) { textBox_SteamPath.Text = Class_utils.read_Registry(); }