private void btnCheck_Click(object sender, EventArgs e) { if (lbAccounts.SelectedIndex < 0) return; if (!string.IsNullOrEmpty(txtUser.Text) && !string.IsNullOrEmpty(txtUser.Text)) return; // stop processing if they have some data // otherwise get acccount:password, // split it into acc and pass and write them to TextBoxes string value = lbAccounts.Items[lbAccounts.SelectedItem]; // I am getting the error above string[] values = value.Split(':'); if (values.Length != 2) return; // wrong format var acc = values[0]; var pass = values[1]; txtUser.Text = acc; txtPass.Text = pass; SendTestMail(); }
string value = Convert.ToString(lbAccounts.SelectedItem);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)