System.Net.HttpWebRequest.Create(url), something simular.
Posted on 2003-11-11
Ok, what I which to acheive is to send my page to an email everytime a person views it.
The emailing part is ok, but how can I save the response.outputstream of my aspx page into a string, once it has run?
Yea it's an odd question I know.
I have this code, which does this from another page but I want to get the stuff from the page that is running.
private String readHtmlPage(string url)
System.Net.WebRequest objRequest = System.Net.HttpWebRequest.Create(url);
objResponse = objRequest.GetResponse();
using (System.IO.StreamReader sr = new System.IO.StreamReader(objResponse.GetResponseStream()) )
result = sr.ReadToEnd();
// Close and clean up the StreamReader