Esempio n. 1
0
        private void btn_load_Click(object sender, EventArgs e)
        {
            var load = new load();

            load.Show();
            load.label_loadtext.Text = "Open the game when this window closes.";
            load.t2.Start();
            this.Close();
        }
Esempio n. 2
0
        private void btn_login_Click(object sender, EventArgs e)
        {
            var load = new load();

            if (tbox_name.Text == "admin" && tbox_pass.Text == "admin")
            {
                try
                {
                    TextWriter tw = new StreamWriter(dir_client_login);

                    if (chbox_savecredentials.Checked == true)
                    {
                        if (File.Exists(dir_client_login))
                        {
                            tw.WriteLine("1" + "\n" + tbox_name.Text + "\n" + tbox_pass.Text);
                            tw.Close();
                        }
                    }
                    else if (chbox_savecredentials.Checked == false)
                    {
                        if (File.Exists(dir_client_login))
                        {
                            tw.WriteLine("0" + "\n" + tbox_name.Text + "\n" + tbox_pass.Text);
                            tw.Close();
                        }
                    }
                }
                catch (Exception ex)
                {
                    throw ex;
                }

                this.Hide();
                load.Show();
                load.t.Start();
            }
            else
            {
                var error = new error();
                error.errorLevel = 1;
                error.Show();
            }
        }