Пример #1
0
 private void Client_UploadValuesCompleted(object sender, UploadValuesCompletedEventArgs e)
 {
     if (OnCreateAccountComplete != null)
     {
         OnCreateAccountComplete.Invoke(this, new OnCreateAccountEventArgs());
     }
     this.Dismiss();
 }
        private void CreateAcc_Click(object sender, EventArgs e)
        {
            WebClient           client     = new WebClient();
            Uri                 uri        = new Uri(URLAddresses.CREATE_ACCOUNT_PHP);
            NameValueCollection parameters = new NameValueCollection();

            parameters.Add("Nick", nick.Text);
            parameters.Add("Login", login.Text);
            parameters.Add("Password", password.Text);
            parameters.Add("Email", email.Text);

            byte[] response            = client.UploadValues(uri, parameters);
            string createAccountStatus = Encoding.UTF8.GetString(response);

            UserAuthority.isAccountCreated = createAccountStatus;
            OnCreateAccountComplete.Invoke(this, new OnCreateAccountEventArgs());
            this.Dismiss();
        }