B
branden.hughes
http://www.dcor.state.ga.us/GDC/OffenderQuery/jsp/OffQryForm.jsp?Institution=vDisclaimer=True
Every time I try it just kicks back the same HTML you'd find from the
link above rather than a page displaying a particular individuals
records. I've tried some generic cookie code to no avail. Any ideas?
I'm working to get a huge process automated for work and this is
literally the only missing piece to the puzzle. Thanks!!
Code below:
string CommandURI =
"http://www.dcor.state.ga.us/GDC/OffenderQuery/jsp/OffQryForm.jsp?Institution=vDisclaimer=True";
HttpWebRequest myWebRequest = (HttpWebRequest)
WebRequest.Create(CommandURI);
myWebRequest.CookieContainer = new CookieContainer();
if (this.Cookies != null && this.Cookies.Count > 0)
myWebRequest.CookieContainer.Add(this.Cookies);
myWebRequest.ContentType = "application/x-www-form-urlencoded";
myWebRequest.Method = "POST";
byte [] bytes =
System.Text.Encoding.ASCII.GetBytes("vUnoCaseNoRadioButton=UNO_NO&vOffenderId=365172");
myWebRequest.ContentLength = bytes.Length;
Stream OutputStream = myWebRequest.GetRequestStream ();
OutputStream.Write (bytes, 0, bytes.Length);
OutputStream.Close ();
HttpWebResponse MyWebResponse = (HttpWebResponse)
myWebRequest.GetResponse();
Stream MyStream = MyWebResponse.GetResponseStream();
// *** Save the cookies on the persistent object
if (MyWebResponse.Cookies.Count > 0)
this.Cookies = MyWebResponse.Cookies;
StreamReader MyStreamReader = new StreamReader(MyStream);
string tryThis = MyStreamReader.ReadToEnd().Trim();
Every time I try it just kicks back the same HTML you'd find from the
link above rather than a page displaying a particular individuals
records. I've tried some generic cookie code to no avail. Any ideas?
I'm working to get a huge process automated for work and this is
literally the only missing piece to the puzzle. Thanks!!
Code below:
string CommandURI =
"http://www.dcor.state.ga.us/GDC/OffenderQuery/jsp/OffQryForm.jsp?Institution=vDisclaimer=True";
HttpWebRequest myWebRequest = (HttpWebRequest)
WebRequest.Create(CommandURI);
myWebRequest.CookieContainer = new CookieContainer();
if (this.Cookies != null && this.Cookies.Count > 0)
myWebRequest.CookieContainer.Add(this.Cookies);
myWebRequest.ContentType = "application/x-www-form-urlencoded";
myWebRequest.Method = "POST";
byte [] bytes =
System.Text.Encoding.ASCII.GetBytes("vUnoCaseNoRadioButton=UNO_NO&vOffenderId=365172");
myWebRequest.ContentLength = bytes.Length;
Stream OutputStream = myWebRequest.GetRequestStream ();
OutputStream.Write (bytes, 0, bytes.Length);
OutputStream.Close ();
HttpWebResponse MyWebResponse = (HttpWebResponse)
myWebRequest.GetResponse();
Stream MyStream = MyWebResponse.GetResponseStream();
// *** Save the cookies on the persistent object
if (MyWebResponse.Cookies.Count > 0)
this.Cookies = MyWebResponse.Cookies;
StreamReader MyStreamReader = new StreamReader(MyStream);
string tryThis = MyStreamReader.ReadToEnd().Trim();