- i get a page using HttpWebRequest with my c# application and want record additional data
string uri = "https://www.xxxxxx.com";
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uri);
request.KeepAlive = false;
request.UserAgent = "mozilla/4.0 (compatible; msie 6.0; windows nt 5.0)";
request.ProtocolVersion = HttpVersion.Version11;
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
// Get the stream containing content returned by the server.
Stream dataStream = response.GetResponseStream();
// Open the stream using a StreamReader for easy access.
StreamReader reader = new StreamReader(dataStream, Encoding.UTF
;
// Read the content.
string responseFromServer = reader.ReadToEnd();
// Cleanup the streams and the response.
reader.Close();
dataStream.Close();
response.Close();
// give conent to internal webbrowser
webBrowser1.DocumentText = responseFromServer;
// install a thread timer for the new data ask
System.Threading.TimerCallback cb = new System.Threading.TimerCallback(ProcessTimerEvent);
System.Threading.Timer timer = new System.Threading.Timer(cb, null, 5000, 1000);
private void ProcessTimerEvent(object obj)
{
???? call something to record data from webBrowser1 or the application
}
- the site get refreshed data from its server after i got the page and displayed in browser1 form
so how could i record it - i thought maybe one has to install some kind of socket or application proxy, which all data has to pass?! but what with the ssl keys? any idea?