Exemplo n.º 1
0
        private void connectBtm_Click(object sender, EventArgs e)
        {
            string ipAddress = GetLocalIPAddress();
            //check if the user connected to the internet at all
            Dictionary <string, string> data = new Dictionary <string, string>()
            {
                { "username", userNameBox.Text },
                { "password", passwordBox.Text },
                { "ip_address", ipAddress }
            };

            if (userNameBox.Text != "" && passwordBox.Text != "")
            {
                HttpHandler handler = new HttpHandler("http://" + SERVER_IP + "/login/");
                string      confirm = handler.Post(data).Result;
                //Console.WriteLine(taskResult);
                //if the username exist and the password match:
                if (!confirm.Equals("F"))
                {
                    homePage hp = new homePage(userNameBox.Text, passwordBox.Text);
                    hp.Show();
                    this.Hide();
                }
            }
        }
Exemplo n.º 2
0
        private void cancelBtm_Click(object sender, EventArgs e)
        {
            homePage m = new homePage();

            m.Show();
            this.Hide();
        }
Exemplo n.º 3
0
        private void endCnnctBtn_Click(object sender, EventArgs e)
        {
            //call end connection function in cpp
            homePage m = new homePage();

            m.Show();
            this.Hide();
        }
Exemplo n.º 4
0
        private void confirm_button_Click(object sender, EventArgs e)
        {
            string ipAddress = GetLocalIPAddress();
            //check if the user connected to internet at all
            Dictionary <string, string> data = new Dictionary <string, string>()
            {
                { "username", ID.Text },
                { "password", Password.Text },
                { "ip_address", ipAddress }
            };
            string confirm = "";

            if (ID.Text != "" && Password.Text != "" && (Password.Text == confirmpsw.Text))
            {
                HttpHandler handler = new HttpHandler("http://" + SERVER_IP + "/register/");
                confirm = handler.Post(data).Result;
                Console.WriteLine(confirm);


                //server confirmation check
                //RegisterRoutes(RouteTable.Routes);

                if (!confirm.Equals("F"))
                {
                    homePage hp = new homePage(ID.Text, Password.Text);
                    hp.Show();
                    this.Hide();
                }
            }



            //Console.WriteLine(taskResult);

            //if the register complited:

            //else:
            //go back to register page with suitable notification
        }