Esempio n. 1
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        int    val;
        String UserName, Password;

        TorrentRef.MyTorrentServiceSoapClient serverHandler = new TorrentRef.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.htm");
        }
        else
        {
            lblHelloWorldResponse.Text = "Wrong Input";
        }
    }
Esempio n. 2
0
    protected void register_btn_Click(object sender, EventArgs e)
    {
        String UserName, Password;

        error_lbl.Text = "";
        TorrentRef.MyTorrentServiceSoapClient serverHandler = new TorrentRef.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";
        }
    }