Guest User

Untitled

a guest
Feb 28th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Web;
  6. using System.Net;
  7. using System.IO;
  8.  
  9. namespace FuseBot
  10. {
  11. public static class Login
  12. {
  13. public static void LoginVoid(string username, string password, string uriString)
  14. {
  15. WebClient myWebClient = new WebClient();
  16. string postData = "username=" + username + "&password=" + password;
  17. Console.WriteLine(postData);
  18. myWebClient.Headers.Add("Content-Type", "application/x-www-form-urlencoded");
  19. byte[] byteArray = Encoding.ASCII.GetBytes(postData);
  20.  
  21. byte[] responseArray = myWebClient.UploadData(uriString, "POST", byteArray);
  22. string response = Encoding.ASCII.GetString(responseArray);
  23. Console.WriteLine(response);
  24. }
  25. }
  26. }
Add Comment
Please, Sign In to add comment