Пример #1
0
        private void buttonLogin_Click(object sender, EventArgs e)
        {
            string site = "http://localhost:11821/";
            string user = Username.Text;
            string pass = Password.Text;
            //try
            //{
            HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create(site + "Token");

            req.Method      = "POST";
            req.ContentType = "application/x-www-form-urlencoded";
            var postData = "grant_type=password";

            postData += "&username="******"&password="******"');

            token = "";
            foreach (var a in x)
            {
                if (token.Length < a.Length)
                {
                    token = a;
                }
            }

            AdminForm form = new AdminForm(token);

            form.Show();
            this.Hide();
            //}
            //catch { MessageBox.Show("Ошибка авторизации"); }
        }
Пример #2
0
 public AddUser(AdminForm Parent)
 {
     InitializeComponent();
     this.Parent = Parent;
 }