Advertisement
Guest User

Untitled

a guest
Jul 16th, 2019
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. class Inhand
  2. {
  3. string id;
  4. string ip;
  5. string username;
  6. string password;
  7.  
  8. public string Id { get => id; set => id = value; }
  9. public string Ip { get => ip; set => ip = value; }
  10. public string Username { get => username; set => username = value; }
  11. public string Password { get => password; set => password = value; }
  12.  
  13. public Inhand(string id, string ip, string username, string password)
  14. {
  15. Id = id;
  16. Ip = ip;
  17. Username = username;
  18. Password = password;
  19. }
  20.  
  21. public void IO_ON()
  22. {
  23. string payload = $"http://{Ip}/apply.cgi/?_ajax=1&_web_cmd=%21%0Aio%20output%201%20on%0A";
  24. byte[] byteArray = Encoding.ASCII.GetBytes(payload);
  25. WebRequest request = WebRequest.Create(payload);
  26. request.Credentials = new NetworkCredential(Username, Password);
  27. request.Method = "POST";
  28. request.ContentLength = (byteArray).Length;
  29. request.ContentType = "application/x-www-form-urlencoded";
  30. Stream datastream = request.GetRequestStream();
  31. datastream.Write(byteArray, 0, payload.Length);
  32. }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement