fork download
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Text.RegularExpressions;
  9. using System.Threading.Tasks;
  10. using System.Windows.Forms;
  11. using System.IO;
  12. using System.Net;
  13.  
  14. namespace entropedizer
  15. {
  16. public partial class Form1 : Form
  17. {
  18. public Form1()
  19. {
  20. InitializeComponent();
  21. }
  22.  
  23. private void Form1_Load(object sender, EventArgs e)
  24. {
  25. // A "pre-request," sent to gather SessionID and POST data parameters for the main request
  26. HttpWebRequest prequest = (HttpWebRequest)WebRequest.Create("http://w...content-available-to-author-only...a.info/Chart.aspx?chart=Chart");
  27. HttpWebResponse presponse = (HttpWebResponse)prequest.GetResponse();
  28. Stream pstream = presponse.GetResponseStream();
  29. StreamReader psr = new StreamReader(pstream);
  30. String phtml = psr.ReadToEnd();
  31.  
  32. Match viewstate = Regex.Match(phtml, "id=\"__VIEWSTATE\".+/>");
  33. Match eventvalidation = Regex.Match(phtml, "id=\"__EVENTVALIDATION\".+/>");
  34. ASCIIEncoding encoding = new ASCIIEncoding();
  35. string postData = "__EVENTTARGET=ctl00%24ContentPlaceHolder1%24DG1%24ctl19%24ctl05&__EVENTARGUMENT=&__LASTFOCUS=&__VIEWSTATE=" + viewstate.ToString().Substring(24, viewstate.Length - 28) + "&__EVENTVALIDATION=" + eventvalidation.ToString().Substring(30, eventvalidation.Length - 34) + "&ctl00%24PlanetList=Entropia+Universe&ctl00%24SearchText=&ctl00%24ContentPlaceHolder1%24CollapsiblePanelExtender3_ClientState=false&ctl00%24ContentPlaceHolder1%24CollapsiblePanelExtender2_ClientState=&ctl00%24ContentPlaceHolder1%24FilterNameDdl=Text&ctl00%24ContentPlaceHolder1%24FilterType=%3D&ctl00%24ContentPlaceHolder1%24FilterName=&ctl00%24ContentPlaceHolder1%24CollapsiblePanelExtender1_ClientState=false&ctl00%24ContentPlaceHolder1%24DG1%24ctl19%24ctl02=1&ctl00%24ContentPlaceHolder1%24DG1%24ctl19%24ctl14=15";
  36. byte[] data = encoding.GetBytes(postData);
  37.  
  38. // The main request, intended to retreive the desired HTML
  39. HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://w...content-available-to-author-only...a.info/Chart.aspx?chart=Chart");
  40. request.Method = "POST";
  41. request.ContentType = "application/x-www-form-urlencoded";
  42. request.ContentLength = data.Length;
  43. request.CookieContainer = new CookieContainer();
  44. Cookie sessionId = new Cookie("ASP.NET_SessionId", Regex.Match(presponse.Headers.ToString(), "ASP.NET_SessionId=.+ d").ToString().Substring(18, Regex.Match(presponse.Headers.ToString(), "ASP.NET_SessionId=.+ d").Length - 21), "/", ".entropedia.info");
  45. sessionId.HttpOnly = true;
  46. request.CookieContainer.Add(new Uri("http://w...content-available-to-author-only...a.info/Chart.aspx?chart=Chart"), sessionId);
  47.  
  48. Stream stream = request.GetRequestStream();
  49. stream.Write(data, 0, data.Length);
  50. stream.Close();
  51.  
  52. HttpWebResponse response = (HttpWebResponse)request.GetResponse();
  53. stream = response.GetResponseStream();
  54.  
  55. StreamReader sr = new StreamReader(stream);
  56. textBox1.Text = sr.ReadToEnd();
  57.  
  58. stream.Close();
  59. sr.Close();
  60. }
  61. }
  62. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cs(4,14): error CS0234: The type or namespace name `Data' does not exist in the namespace `System'. Are you missing an assembly reference?
prog.cs(9,24): error CS0234: The type or namespace name `Tasks' does not exist in the namespace `System.Threading'. Are you missing an assembly reference?
prog.cs(10,14): error CS0234: The type or namespace name `Windows' does not exist in the namespace `System'. Are you missing an assembly reference?
Compilation failed: 3 error(s), 0 warnings
stdout
Standard output is empty