Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void login()
- {
- try
- {
- CookieContainer cookieContainer = new CookieContainer();
- UTF8Encoding uTF8Encoding = new UTF8Encoding();
- byte[] bytes = uTF8Encoding.GetBytes(this.postdata);
- HttpWebRequest httpWebRequest = (HttpWebRequest)WebRequest.Create("https://api-global.n...m/account/auth");
- httpWebRequest.Method = "POST";
- httpWebRequest.KeepAlive = true;
- httpWebRequest.Accept = "*/*";
- httpWebRequest.ContentType = "text/xml; charset=utf-8";
- httpWebRequest.UserAgent = " Mozilla/4.0 (compatible; MSIE 6.0; MS Web Services Client Protocol 4.0.30319.17929)";
- httpWebRequest.ContentLength = (long)bytes.Length;
- Stream requestStream = httpWebRequest.GetRequestStream();
- requestStream.Write(bytes, 0, bytes.Length);
- requestStream.Close();
- HttpWebResponse httpWebResponse = (HttpWebResponse)httpWebRequest.GetResponse();
- this.postcookie.Add(httpWebResponse.Cookies);
- StreamReader streamReader = new StreamReader(httpWebResponse.GetResponseStream());
- this.str1 = streamReader.ReadToEnd();
- streamReader.Close();
- }
- catch (Exception expr_CE)
- {
- ProjectData.SetProjectError(expr_CE);
- Exception ex = expr_CE;
- this.str1 = "error" + ex.ToString();
- ProjectData.ClearProjectError();
- }
- }
Add Comment
Please, Sign In to add comment