예제 #1
0
        protected void register_btn_Click(object sender, EventArgs e)
        {
            String UserName, Password;

            error_lbl.Text = "";
            TorrentService.MyTorrentServiceSoapClient serverHandler = new TorrentService.MyTorrentServiceSoapClient();

            UserName = username_txt.Text.Trim();
            Password = password_txt.Text.Trim();


            // clean fields:
            username_txt.Text = "";
            password_txt.Text = "";


            if (serverHandler.checkUser(UserName, Password, "Register") == 0)
            {
                serverHandler.manageUserList(UserName, Password, 0, "New User");
                error_lbl.Text = "Welcome to Torrent SK!";
            }
            else
            {
                error_lbl.Text = "User allready exists";
            }
        }
예제 #2
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            int    val;
            String UserName, Password;

            TorrentService.MyTorrentServiceSoapClient serverHandler = new TorrentService.MyTorrentServiceSoapClient();

            UserName = txtUsername.Text.Trim();
            Password = txtPassword.Text.Trim();

            // clean fields:
            txtUsername.Text = "";
            txtPassword.Text = "";
            val = serverHandler.checkUser(UserName, Password, "Sign In");

            if (val > 0)
            {
                lblHelloWorldResponse.Text = "Login Succeeded";
                Response.Redirect("HomePage.html");
            }
            else
            {
                lblHelloWorldResponse.Text = "Wrong Input";
            }
        }