Hi Machin,
Nothing is wrong with the piece of code that I showed.
All I am looking forward for is an alternative method to achieve the same.
Something which could be as dynamic as a "Ctrl + F" search on a HTML page.
With which I can avoid the overkill of reading the entire data through a
Stream Reader.
Any leads on this would be very helpful
Thanks,
Kuldeep
"Ignacio Machin ( .NET/ C# MVP )" <machin TA laceupsolutions.comwrote in
message news:en**************@TK2MSFTNGP05.phx.gbl...
Hi,
What is wrong with that code?
you could use a memorystream to store all the page in memory and then
later send it back in the response.
--
Ignacio Machin
machin AT laceupsolutions.com
"Kuldeep" <ku****************@hotmail.comwrote in message
news:u4**************@TK2MSFTNGP02.phx.gbl...
>Hi All,
I am trying to read the contents of a page through its URL.
My code snippet is as follows:
public void mtdGetPageDataHWR()
{
HttpWebRequest objRequ =
(HttpWebRequest)WebRequest.Create("http://www.microsoft.com");
HttpWebResponse objResp = (HttpWebResponse)objRequ.GetResponse();
string strVersion = objResp.ProtocolVersion.ToString();
StreamReader objRd = new StreamReader(objResp.GetResponseStream());
string strRd = objRd.ReadLine();
while(strRd!=null)
{
Response.Write(strRd);
strRd = objRd.ReadLine();
}
}
Is there any other way to achieve this which could be more efficient or
faster than this.
Any help on this would be very handy
Thanks,
Kuldeep