当前位置: 首页>>代码示例>>C#>>正文


C# MainPage.Show方法代码示例

本文整理汇总了C#中MainPage.Show方法的典型用法代码示例。如果您正苦于以下问题:C# MainPage.Show方法的具体用法?C# MainPage.Show怎么用?C# MainPage.Show使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MainPage的用法示例。


在下文中一共展示了MainPage.Show方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: LoginButton_Click

        private void LoginButton_Click(object sender, EventArgs e)
        {
            //  mySQLconnection.Open();

            /*
                MySqlCommand mySQLcommand = new MySqlCommand("SELECT * FROM SUser WHERE username = @username AND password = @password");

                if (this.OpenConnection() == true)
                {
                    mySQLcommand.Parameters.AddWithValue("username", UsernameTextBox.Text);
                    mySQLcommand.Parameters.AddWithValue("password", PasswordTextBox.Text);
                    MySqlDataReader dataReader = mySQLcommand.ExecuteReader();
                    while(dataReader.Read())
                    {
                        mainpage = new MainPage();
                        mainpage.Show();
                    }
                    dataReader.Close();
                }
            //mainpage = new MainPage();
               // mainpage.Show();
             * */

            DBConnect db = new DBConnect();
            DataTable dataTable = db.GetUser(PasswordTextBox.Text, UsernameTextBox.Text);
            if (dataTable != null)
            {
                mainpage = new MainPage();
                mainpage.Show();
                //MessageBox.Show(dataTable.ToString());
            }
            else MessageBox.Show("Noe gikk galt");
        }
开发者ID:RosaRom,项目名称:systemutvikling,代码行数:33,代码来源:LoginForm.cs

示例2: Image_MouseLeftButtonDown

 private void Image_MouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
 {
 	// TODO: Add event handler implementation here.
     
     MainPage mainPage = new MainPage();
     mainPage.Show();
     this.Close();
 }
开发者ID:mylgoehy,项目名称:tiengvietlop7,代码行数:8,代码来源:LessonPage.xaml.cs

示例3: backButton_Click

		private void backButton_Click(object sender, System.Windows.RoutedEventArgs e)
		{
            MainPage w1 = new MainPage();

            Window parent = Window.GetWindow(this);
            parent.Close();

            w1.Show();
		}
开发者ID:JSkally,项目名称:...,代码行数:9,代码来源:Login.xaml.cs

示例4: btnSubmit_Click

 private void btnSubmit_Click(object sender, EventArgs e)
 {
     if (txtName.Text == "pawan")
     {
         //this.Close();
         MainPage obj = new MainPage();
         obj.Show();
         this.Hide();
     }
 }
开发者ID:Chitra89,项目名称:Totals,代码行数:10,代码来源:Form1.cs

示例5: loginButton_Click

        private void loginButton_Click(object sender, RoutedEventArgs e)
        {
            MessageBox.Show("Login Successful", "Welcome, " + usernameTextBox.Text);
            
            MainPage w1 = new MainPage();

            Window parent = Window.GetWindow(this);
            parent.Close();
                       
            w1.Show();


            
        
        }
开发者ID:JSkally,项目名称:...,代码行数:15,代码来源:Login.xaml.cs

示例6: checkSuccess

 private void checkSuccess()
 {
     string userName = tbUserName.Text;
     string password = tbPassWord.Password;
     if ((bool)isAutoSave.IsChecked) {
         IniHelper.WriteINI("userlogin", new string[] { "username", "password", "autosave" }, new string[] { userName, password, "1" });
     }
     else {
         IniHelper.WriteINI("userlogin", new string[] { "username", "password", "autosave" }, new string[] { "", "", "0" });
     }
     this.Hide();
     MainPage mainpage = new MainPage();
     mainpage.Show();
     mainpage.Activate();
     mainpage.menu.SetUserName(userName);
     lbErrorMsg.Visibility = Visibility.Hidden;
 }
开发者ID:whw123,项目名称:spatial,代码行数:17,代码来源:MainWindow.xaml.cs

示例7: button1_Click

        private void button1_Click(object sender, EventArgs e)
        {
            NpgsqlConnection conn = new NpgsqlConnection("Server=webblabb.miun.se;Port=5432;Database=grp3vt13;User Id=grp3vt13;Password=XmFGFwX6t;SSL=true");
                try
                {
                    conn.Open();
                    NpgsqlCommand command1 = new NpgsqlCommand("SELECT password, firstname FROM staff WHERE firstname = ('" + txtUser.Text + "')", conn);
                    //hämtar alla användare som heter t.ex "Björn", detta kan ersättas med unikare saker, t.ex mail
                    object objPassword = command1.ExecuteScalar(); //= är lösenordet för Björn
                    string stringPassword = Convert.ToString(objPassword);

                    if (!string.IsNullOrEmpty("" + stringPassword))
                    {
                        if (stringPassword == txtPassword.Text)
                        {
                            MainPage mp = new MainPage();
                            mp.Show();
                            this.Hide();
                        }
                        else
                        {
                            MessageBox.Show("Användarnamn eller lösenord felaktigt. vänligen försök igen (lösen)");
                        }
                    }
                    else
                    {
                        MessageBox.Show("Användarnamn eller lösenord felaktigt. vänligen försök igen (lösen/användarnamn)");
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.ToString());
                }
                finally
                {
                    conn.Close();
                }
        }
开发者ID:rikardw,项目名称:Golfklubban,代码行数:38,代码来源:Login.cs

示例8: Login_Click

        private void Login_Click(object sender, EventArgs e)
        {
            
            int result = sr.checkUser(Username.Text, Password.Text, PostalCode.Text);
            if (result == 0)
            {
                /*
                Response.Cookies["username"].Value = UsernameText.Text;
                Session["sessionName"] = UsernameText.Text;
                Response.Redirect("MainPage.aspx");*/
                this.Hide();
                MainPage f2 = new MainPage();
                f2.Size = new System.Drawing.Size(900, 563);
                f2.Show();
            }

            if (result == -1)
                MessageBox.Show("Wrong Username/Not registered");
            if (result == -2)
                MessageBox.Show("Wrong Password");
            if (result == 1)
                MessageBox.Show("unexpected errorrrererrr");
        }
开发者ID:ViktorMeduneckij,项目名称:Food-MobileApp,代码行数:23,代码来源:Form1.cs

示例9: button_Return_Click

        private void button_Return_Click(object sender, EventArgs e)
        {
            MainPage mainPage = new MainPage();

            mainPage.Show();
        }
开发者ID:TrineStudio,项目名称:DBDesign-Tongji,代码行数:6,代码来源:RailSystem.cs

示例10: InitView

 public bool InitView(MainPage main)
 {
     main.Show(this);
     return true;
 }
开发者ID:burstas,项目名称:rmps,代码行数:5,代码来源:Demo.xaml.cs

示例11: BackButton_Click

 private void BackButton_Click(object sender, RoutedEventArgs e)
 {
     MainPage mainPage = new MainPage();
     mainPage.Show();
     this.Close();
 }
开发者ID:mylgoehy,项目名称:tiengvietlop7,代码行数:6,代码来源:GrammarPage.xaml.cs

示例12: enterButton_Click

        private void enterButton_Click(object sender, EventArgs e)
        {
            string username = usernameBox.Text;
            string password = passwordBox.Text;
            string temp = username + password;

            if (!MainPage.IsLetterOrDigit(temp))
            {
                MessageBox.Show("Restrict your input to letters and numbers.  Or else.");
                return;
            }

            string connectionString = "user id=CSSE333-201212-SuperSmashBros;" +
                                       "Password=supersmashbros;" +
                                       "server=whale.cs.rose-hulman.edu;" +
                                       "Trusted_Connection=no;" +
                                       "Database=SuperSmashBros;" +
                                       "connection timeout=30;" +
                                       "TrustServerCertificate=true";

            SqlConnection connection = null;
            SqlDataReader sdr = null;

            try
            {
                connection = new SqlConnection(connectionString);
                connection.Open();
                string cmd = "LoginPlayer";
                //"SELECT * " +
                //"FROM PLAYER AS p " +
                //"WHERE p.Username = \'" + username + "\' AND p.Password = \'" + password + "\'";

                SqlCommand command = new SqlCommand(cmd, connection);
                command.CommandType = CommandType.StoredProcedure;

                SqlParameter retval = new SqlParameter("@Return_Value", SqlDbType.Int);
                retval.Direction = ParameterDirection.ReturnValue;
                retval.Value = -1;

                string hashpasswd = MainPage.GetSHAHash("Richard!" + username + "[email protected]" + password + "Seth#");

                command.Parameters.Add(new SqlParameter("@pUsername", username));
                command.Parameters.Add(new SqlParameter("@pPassword", hashpasswd));

                command.Parameters.Add(retval);

                command.ExecuteNonQuery();

                int success = Int32.Parse(retval.Value.ToString());

                if (success > 0)
                {
                    connection.Close();
                    connection.Dispose();
                    MainPage main = new MainPage(this, username, hashpasswd);
                    main.Show();
                    this.Hide();
                }
                else
                    MessageBox.Show("Login failed.  Try again or register!");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
            finally
            {
                if (null != connection)
                {
                    connection.Close();
                    connection.Dispose();
                }
                if (null != sdr)
                {
                    sdr.Close();
                }
            }
        }
开发者ID:krenztr,项目名称:Super-Smash-Bros-Database,代码行数:78,代码来源:LoginPage.cs


注:本文中的MainPage.Show方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。