Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void Button1_Click(object sender, EventArgs e)
- {
- string username = textBox1.Text;
- string password = textBox2.Text;
- string holdername = textBox3.Text;
- string phone = textBox4.Text;
- string gender = comboBox1.SelectedItem.ToString();
- string[] vals = { username, password, holdername, phone, gender, Environment.NewLine };
- if (textBox1.Text == "" || textBox2.Text == "" || textBox3.Text == "" || textBox4.Text == "")
- {
- MessageBox.Show("Textbox should not left empty");
- goto exit;
- }
- else using (StreamWriter sr = new StreamWriter("account.txt", true))
- {
- sr.Write(string.Join(" ", vals));
- MessageBox.Show("Account successfully created");
- }
- exit:;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement