コード例 #1
0
        private void register_button_Click(object sender, EventArgs e)
        {
            UserServiceReference.User n_user = new UserServiceReference.User();

            n_user.UserID   = userid_textBox.Text;
            n_user.Password = pass_textBox.Text;

            UserServiceReference.UserServiceClient proxy = new UserServiceReference.UserServiceClient("BasicHttpBinding_IUserService");

            proxy.AddUser(n_user);

            LoginForm lf = new LoginForm();

            lf.Show();
            this.Close();
        }
コード例 #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            userid = textBox1.Text;
            string pass = textBox2.Text;

            UserServiceReference.UserServiceClient proxy = new UserServiceReference.UserServiceClient("BasicHttpBinding_IUserService");

            UserServiceReference.User o_user = new UserServiceReference.User();

            o_user = proxy.GetUser(userid);

            if (o_user.Password == pass)
            {
                StoreForm sf = new StoreForm();
                sf.Show();
                this.Hide();
            }
            else
            {
                MessageBox.Show("Incorrect Password.");
            }
        }