public LoggerForm() { InitializeComponent(); string path = ""; OpenFileDialog file = new OpenFileDialog(); if (file.ShowDialog() == DialogResult.OK) { path = file.FileName; } else { Application.Exit(); } DBConnectionManager cm = new DBConnectionManager(path, "OleDb"); logger = new Logger(cm.GetAdapter("SELECT * FROM Messages"), cm.GetAdapter("SELECT * FROM Users")); LoginForm frm = new LoginForm(); string res = ""; do { frm.ShowDialog(); res = PonyboxClient.LoadUser(frm.GetUser(), frm.GetPass()); } while (res == ""); initCB(res); }
private void buttonStart_Click(object sender, EventArgs e) { string path = ""; OpenFileDialog file = new OpenFileDialog(); if (file.ShowDialog() == DialogResult.OK) { path = file.FileName; } else { Application.Exit(); } DBConnectionManager cm = new DBConnectionManager(path, "OleDb"); AccountDatabase db = new AccountDatabase(cm.GetAdapter("SELECT * FROM Accounts")); ForumClient.Login("username", "password"); List <ForumUser> u = ForumClient.GetFullUserList(25); Console.WriteLine("Storing " + u.Count + " users"); db.LogUsers(u); MessageBox.Show("Process ended successfully"); }