Its really urgent.Here is the code i used to generate the html from aspx page
WebRequest myRequest = WebRequest.Create("http://localhost:11335/Convert-asptohtml-2/Dups.aspx");
//Return the response.
WebResponse myResponse = myRequest.GetResponse();
//Obtain a 'Stream' object associated with the response object.
Stream ReceiveStream = myResponse.GetResponseStream();
Encoding encode = System.Text.Encoding.GetEncoding("utf-8");
//Pipe the stream to a higher level stream reader with the required encoding format.
StreamReader readStream = new StreamReader(ReceiveStream, encode);
//Read 256 charcters at a time.
Char[] read = new Char[256];
int count = readStream.Read(read, 0, 256);
String str1 = "";
using (StreamWriter sw = new StreamWriter("MyPage.htm"))
{
while (count > 0)
{
// Dump the 256 characters on a string and display the string onto the console.
str1 = new String(read, 0, count);
sw.Write(str1);
count = readStream.Read(read, 0, 256);
}
}
// Close the response to free resources.
myResponse.Close();

New Topic/Question
Reply




MultiQuote




|