0

アプリのログインページを作りたいのですが、登録時のデータが保存されません...

これが私のコードです...

//String data;
            Debug.WriteLine(username_signup_textbox.Text);
            Debug.WriteLine(password_signup_textbox.Password);
            WebClient signup = new WebClient();

            StringBuilder data = new StringBuilder();
            data.AppendFormat("{0}={1}&", "username", HttpUtility.UrlEncode(username_signup_textbox.Text));
            data.AppendFormat("{0}={1}", "password", HttpUtility.UrlEncode(password_signup_textbox.Password));
            //data = "username=" + username_signup_textbox.Text + "&password=" + password_signup_textbox.Text;
            //signup.Headers[HttpRequestHeader.ContentType] = "application/x-www-form-urlencoded";
            //signup.Headers[HttpRequestHeader.ContentLength] = data.Length.ToString();
            signup.Headers["Content-type"] = "application/xml";
            signup.Encoding = Encoding.UTF8; 

            Uri uri = new Uri("http://192.168.1.105/signup.xml", UriKind.Absolute);
            signup.UploadStringCompleted += new UploadStringCompletedEventHandler(signup_UploadStringCompleted);
            signup.UploadProgressChanged += new UploadProgressChangedEventHandler(signup_UploadProgressChanged);
            signup.UploadStringAsync(uri, "POST", data.ToString());
            Debug.WriteLine(data.ToString());

どこが正しくないのですか?ありがとうございました。

4

0 に答える 0