daily pastebin goal
74%
SHARE
TWEET

Untitled

a guest Feb 13th, 2018 54 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var request = ( HttpWebRequest )WebRequest.Create( "https://plm.programsoyuz.ru/f80ef7a0/login" );
  2.                 var postData = string.Format( "login={0}&password={1}", login, password );
  3.                 var data = Encoding.ASCII.GetBytes( postData );
  4.  
  5.                 request.Credentials = new NetworkCredential();
  6.                 request.Method = "POST";
  7.                 request.ContentType = "application/x-www-form-urlencoded";
  8.                 request.ContentLength = data.Length;
  9.                 request.CookieContainer = new CookieContainer();
  10.  
  11.                 try
  12.                 {
  13.                     using( var response = ( HttpWebResponse )request.GetResponse() )
  14.                     {
  15.                         if( response.StatusCode == HttpStatusCode.Moved )
  16.                         {
  17.                             CookieHelper.Cookies.Add( response.Cookies );
  18.                             var webView = FindViewById<WebView>( Resource.Id.WebBrowser );
  19.                             webView.Settings.JavaScriptEnabled = true;
  20.                             webView.SetWebViewClient( new CookieWebViewClient( webView ) );
  21.                             webView.Visibility = ViewStates.Visible;
  22.                             webView.LoadUrl( "https://plm.programsoyuz.ru/f80ef7a0/" );
  23.                         }
  24.                     }
  25.                 }
  26.                 catch( Exception e )
  27.                 {
  28.                     Toast.MakeText( ApplicationContext, e.Message, ToastLength.Short ).Show();
  29.                 }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top