Author: Nik. Date 2015-06-18 18:19:46, views: 236, Raw

Увеличить
String firstName = "Владимир Васильевич",
                        lastName = "Кирюхин",
                        mounth_ = "Январь",
                        serveceCenter = "Алтайский край",
                        address3 = "Район",
                        city_ = "Барнаул г.",
                        address1 = "Антона Петрова",
                        btnNext = "Зарегистрироваться";
 
                try {
                    firstName = new String(firstName.getBytes("UTF-8"),"UTF-8");
                    lastName = new String(lastName.getBytes("UTF-8"),"UTF-8");
                    mounth_ = new String(mounth_.getBytes("UTF-8"),"UTF-8");
                    serveceCenter = new String(serveceCenter.getBytes("UTF-8"),"UTF-8");
                    address3 = new String(address3.getBytes("UTF-8"),"UTF-8");
                    city_ = new String(city_.getBytes("UTF-8"),"UTF-8");
                    address1 = new String(address1.getBytes("UTF-8"),"UTF-8");
                    btnNext = new String(btnNext.getBytes("UTF-8"),"UTF-8");
                } catch (UnsupportedEncodingException e) {
                    e.printStackTrace();
                }
                //отправка на сервер
                Ion.with(context)
                        .load("https://ru-eshop.oriflame.com/iframe/Consultant/Registration.aspx")
                        .setBodyParameter("ctl00_RadScriptManager1_TSM", ";;System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35:en-US:fa6755fd-da1a-49d3-9eb4-1e473e780ecd:ea597d4b:b25378d2;Telerik.Web.UI, Version=2014.2.724.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4:en-US:cbcc33a2-4a25-4f6b-85e3-8e20bc385048:16e4e7cd:f7645509:24ee1bba:f46195d3:2003d0b8:88144a7a:1e771326:aa288e2d:258f1c72;")
                        .setBodyParameter("ctl00$cphContent$txtInputStep", "0")
                        .setBodyParameter("ctl00$cphContent$hidQuickFormMode", "1")
                        .setBodyParameter("ctl00$cphContent$txtEmail", "wex@ya.ru")
                        .setBodyParameter("ctl00$cphContent$txtPasswd", "wex123321")
                        .setBodyParameter("ctl00$cphContent$txtLastName", lastName)
                        .setBodyParameter("ctl00$cphContent$txtFirstName", firstName)
                        .setBodyParameter("ctl00$cphContent$txtUniqueId", "0409999888")
                        .setBodyParameter("ctl00$cphContent$dtpBirthDateCmb_cmbDay", "1")
                        .setBodyParameter("ctl00_cphContent_dtpBirthDateCmb_cmbDay_ClientState", "")
                        .setBodyParameter("ctl00$cphContent$dtpBirthDateCmb_cmbMonth", mounth_)
                        .setBodyParameter("ctl00_cphContent_dtpBirthDateCmb_cmbMonth_ClientState", "get_splashName")
                        .setBodyParameter("ctl00$cphContent$dtpBirthDateCmb_cmbYear", "1970")
                        .setBodyParameter("ctl00_cphContent_dtpBirthDateCmb_cmbYear_ClientState", "")
                        .setBodyParameter("ctl00$cphContent$txtMobile", "79233335577")
                        .setBodyParameter("ctl00$cphContent$cmbServiceCentre", serveceCenter)
                        .setBodyParameter("ctl00_cphContent_cmbServiceCentre_ClientState", "")
                        .setBodyParameter("ctl00$cphContent$ctrlAddr$hidLastLevelPK", "")
                        .setBodyParameter("ctl00$cphContent$ctrlAddr$cmbPostCode", "656000")
                        .setBodyParameter("ctl00_cphContent_ctrlAddr_cmbPostCode_ClientState", "")
                        .setBodyParameter("ctl00$cphContent$ctrlAddr$cmbAddress3", address3)
                        .setBodyParameter("ctl00_cphContent_ctrlAddr_cmbAddress3_ClientState", "")
                        .setBodyParameter("ctl00$cphContent$ctrlAddr$cmbCity", city_)
                        .setBodyParameter("ctl00_cphContent_ctrlAddr_cmbCity_ClientState", "")
                        .setBodyParameter("ctl00$cphContent$ctrlAddr$cmbAddress1", address1)
                        .setBodyParameter("ctl00_cphContent_ctrlAddr_cmbAddress1_ClientState", "")
                        .setBodyParameter("ctl00$cphContent$ctrlAddr$txtAddress2", "197-20")
                        .setBodyParameter("ctl00$cphContent$txtReqSponsor", "11607716")
                        .setBodyParameter("ctl00$cphContent$txtSponsorName", "")
                        .setBodyParameter("ctl00$cphContent$chkAgreement", "on")
                        .setBodyParameter("ctl00$cphContent$chkAgreement2", "on")
                        .setBodyParameter("ctl00$cphContent$btnNext", btnNext)
                        .asString()
                        .setCallback(new FutureCallback<String>() {
                            @Override
                            public void onCompleted(Exception e, String s) {
                                if (e == null) {
                                    String str = "";
                                    str = s;
                                } else {
                                    e.printStackTrace();
                                }
                            }
                        });