Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void button1_Click(object sender, EventArgs e)
- {
- string Username = tbUser.Text;
- string Password = tbPassword.Text;
- string path = @"C:/data.txt";
- string NewUser = "New User......";
- if (!System.IO.File.Exists(path))
- {
- System.IO.File.Create("C:/data.txt");
- }
- string line1, line2, line3, line4, line5, line6, line7, line8, line9, line10;
- using (StreamReader reader = new StreamReader(path))
- {
- line1 = reader.ReadLine();
- line2 = reader.ReadLine();
- line3 = reader.ReadLine();
- line4 = reader.ReadLine();
- line5 = reader.ReadLine();
- line6 = reader.ReadLine();
- line7 = reader.ReadLine();
- line8 = reader.ReadLine();
- line9 = reader.ReadLine();
- line10 = reader.ReadLine();
- }
- if (cb1.Text == NewUser && (line1 == ""))
- {
- tbUser.Text = "Username";
- tbPassword.Text = "Password";
- }
- else if (cb1.Text == NewUser && (line4 == ""))
- {
- tbUser.Text = "Username";
- tbPassword.Text = "Password";
- }
- else if (cb1.Text == NewUser && (line6 == ""))
- {
- tbUser.Text = "Username";
- tbPassword.Text = "Password";
- }
- else if (cb1.Text == NewUser && (line8 == ""))
- {
- tbUser.Text = "Username";
- tbPassword.Text = "Password";
- }
- else if (cb1.Text == NewUser && (line10 == ""))
- {
- tbUser.Text = "Username";
- tbPassword.Text = "Password";
- }
Add Comment
Please, Sign In to add comment