SHARE
TWEET

Untitled

a guest Jul 16th, 2019 105 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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 baseurl = $"http://{Ip}/apply.cgi";
  24.             string payload = "_ajax=1&_web_cmd=%21%0Aio%20output%201%20on%0A";
  25.             Uri myUri = new Uri(baseurl + payload);
  26.             WebRequest mywebRequest = HttpWebRequest.Create(myUri);
  27.             HttpWebRequest myHttpWebRequest = (HttpWebRequest)mywebRequest;
  28.  
  29.             WebRequest request = WebRequest.Create(baseurl);
  30.             request.Method = "POST";
  31.  
  32.             NetworkCredential myNetworkCredential = new NetworkCredential(username, password);
  33.             CredentialCache myCredentialCach = new CredentialCache();
  34.             myCredentialCach.Add(myUri, "Basic", myNetworkCredential);
  35.  
  36.             myHttpWebRequest.PreAuthenticate = true;
  37.             myHttpWebRequest.Credentials = myCredentialCach;
  38.  
  39.                        
  40.  
  41.         }
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