Example #1
0
        private static void Main(string[] args)
        {
            const int PORT    = 8080;
            var       port    = args.Length == 0 ? PORT : int.Parse(args[0]);
            var       chnanel = new Channel($"localhost:{port}", ChannelCredentials.Insecure);
            var       client  = new UserService.UserServiceClient(chnanel);
            var       result  = client.GetUser(new NotFound());

            Console.WriteLine(result.ToString());
        }
Example #2
0
        private void loginButton_Click(object sender, EventArgs e)
        {
            var login    = loginTextBox.Text;
            var password = passwordTextBox.Text;
            var client   = new UserService.UserServiceClient();

            try
            {
                user = client.Login(login, password);
                passwordTextBox.Text = user.password;
                popupPanel.BringToFront();
                popupPanel.Visible = true;
            }
            catch
            {
                ShowNotification("Что-то не так");
            }
        }