Example #1
0
        private void complete()
        {
            if (loggedin && hwid)
            {
                try
                {
                    accesscheck();
                    if (accesslvl == "admin")
                    {
                        MessageBox.Show("Welcome, " + userInfo + "!\nYou are logged in as an admin.", "Logged in!", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                }
                catch (Exception ex)
                { MessageBox.Show("Error: " + ex.Message, "Report this error!", MessageBoxButtons.OK, MessageBoxIcon.Error); }

                string[] values = { DateTime.Now.ToString(), HLlib.Functions.getIP(), userInfo, hwidResult, HLlib.Functions.getPCName() };
                Database.databaseAccess.CreateUTable(userInfo);
                Database.databaseAccess.InsertInto(userInfo, values);

                string[] logvalue = { DateTime.Now.ToString(), userInfo, HLlib.Functions.getIP(), "Admin Login" };
                Database.databaseAccess.InsertInto("log", logvalue);

                Database.databaseAccess.UpdateUserInfo("accounts", "ip", HLlib.Functions.getIP(), "username", userInfo);
                Database.databaseAccess.UpdateUserInfo("accounts", "pcname", HLlib.Functions.getPCName(), "username", userInfo);
                Database.databaseAccess.UpdateUserInfo("accounts", "hwid", hwidResult, "username", userInfo);

                AdminMain goAdmin = new AdminMain();
                goAdmin.Show();
                this.Hide();
            }
            else
            {
                MessageBox.Show("Something else went wrong..", "Failed", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Example #2
0
        private void complete()
        {
            if (loggedin && hwid)
            {
                try
                {
                    accesscheck();
                    if (accesslvl == "admin")
                        MessageBox.Show("Welcome, " + userInfo + "!\nYou are logged in as an admin.", "Logged in!", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                catch (Exception ex)
                { MessageBox.Show("Error: " + ex.Message, "Report this error!", MessageBoxButtons.OK, MessageBoxIcon.Error); }

                string[] values = { DateTime.Now.ToString(), HLlib.Functions.getIP(), userInfo, hwidResult, HLlib.Functions.getPCName() };
                Database.databaseAccess.CreateUTable(userInfo);
                Database.databaseAccess.InsertInto(userInfo, values);

                string[] logvalue = { DateTime.Now.ToString(), userInfo, HLlib.Functions.getIP(), "Admin Login" };
                Database.databaseAccess.InsertInto("log", logvalue);

                Database.databaseAccess.UpdateUserInfo("accounts", "ip", HLlib.Functions.getIP(), "username", userInfo);
                Database.databaseAccess.UpdateUserInfo("accounts", "pcname", HLlib.Functions.getPCName(), "username", userInfo);
                Database.databaseAccess.UpdateUserInfo("accounts", "hwid", hwidResult, "username", userInfo);

                AdminMain goAdmin = new AdminMain();
                goAdmin.Show();
                this.Hide();
            }
            else
                MessageBox.Show("Something else went wrong..", "Failed", MessageBoxButtons.OK, MessageBoxIcon.Error);
        }