Advertisement
Guest User

Untitled

a guest
Jul 27th, 2015
234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. string account = "bill";
  2. string password = "pass1000";
  3. string ip = new WebClient().DownloadString("http://icanhazip.com");
  4.  
  5. ASCIIEncoding encoding = new ASCIIEncoding();
  6. string postData = "account=" + account + "&password=" + password + "&ip=" + ip;
  7. byte[] data = encoding.GetBytes(postData);
  8.  
  9. WebRequest request = WebRequest.Create("http://WEBSITE.COM/post.php");
  10. request.Method = "POST";
  11. request.ContentType = "application/x-www-form-urlencoded";
  12. request.ContentLength = data.Length;
  13.  
  14. Stream stream = request.GetRequestStream();
  15. stream.Write(data, 0, data.Length);
  16. stream.Close();
  17.  
  18. if (isset($_GET['postData'])){
  19. //insert account, password, ip, to my database.
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement