Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Account
- {
- public static List<Account> myAccountList = new List<Account>();
- public string Domain; //this is supposed to be google/skype/facebook
- public string Email;
- public string Username;
- public string Password;
- public Account (string domain, string email, string username, string password)
- {
- Domain = domain;
- Email = email;
- Username = username;
- Password = password;
- myAccountList.Add(new Account(domain, email, username, password)); //constructor calls the new list instance
- }
- private static void SaveToFile()
- {
- System.IO.File.WriteAllLines(@accountdb.txt, myAccountList);
- }
- private static void ReadFromFile() // this is meant to be used as authentication in my main form, it isn't necessary right now..
- {
- System.IO.File.ReadAllLines(@accountdb.txt);
- }
- }
- private void buttonSave_Click(object sender, EventArgs e)
- {
- string domain, email, username, password;
- domain = comboboxDomain.Text;
- email = textboxEmail.Text;
- username = textboxUsername.Text;
- password = textboxPassword.Text;
- //Checking for correct EMAIL
- if (!textboxEmail.Text.Contains("@") && (!textboxEmail.Text.Contains(".")))
- {
- MessageBox.Show("Invalid Email Format");
- }
- else
- {
- Account account = new Account(domain, email, username, password);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement