Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Inhand
- {
- string id;
- string ip;
- string username;
- string password;
- public string Id { get => id; set => id = value; }
- public string Ip { get => ip; set => ip = value; }
- public string Username { get => username; set => username = value; }
- public string Password { get => password; set => password = value; }
- public Inhand(string id, string ip, string username, string password)
- {
- Id = id;
- Ip = ip;
- Username = username;
- Password = password;
- }
- public void IO_ON()
- {
- string payload = $"http://{Ip}/apply.cgi/?_ajax=1&_web_cmd=%21%0Aio%20output%201%20on%0A";
- byte[] byteArray = Encoding.ASCII.GetBytes(payload);
- WebRequest request = WebRequest.Create(payload);
- request.Credentials = new NetworkCredential(Username, Password);
- request.Method = "POST";
- request.ContentLength = (byteArray).Length;
- request.ContentType = "application/x-www-form-urlencoded";
- Stream datastream = request.GetRequestStream();
- datastream.Write(byteArray, 0, payload.Length);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement