Пример #1
0
        private void button4_Click(object sender, EventArgs e)
        {
            sqlFunctions sql = new sqlFunctions();

            if (sql.writeAvatar(textBox6.Text, textBox1.Text) == true)
            {
                pictureBox2.ImageLocation = textBox6.Text;
                MessageBox.Show("Avatar was successfully updated!", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                MessageBox.Show("Failed to update avatar!", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }
Пример #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            string appPath = Path.GetDirectoryName(Application.ExecutablePath);

            System.IO.StreamReader file = new System.IO.StreamReader(appPath + "/lastuser.txt");
            string user;

            user = file.ReadLine();
            file.Close();
            sqlFunctions sql = new sqlFunctions();

            if (sql.writeAvatar(textBox1.Text, user) == true)
            {
                this.Close();
            }
            else
            {
            }
        }