stream - How can I only receive part of an HTTP web response in C# -


i'm wondering if there way in c# & read http web response point. example:

public static void example() {     httpwebrequest request = (httpwebrequest)webrequest.createhttp("http://www.example.com/");      using(httpwebresponse response = (httpwebresponse)request.getresponse())     {         using(stream responsestream = response.getresponsestream())         {             using(streamreader responsereader = new streamreader(responsestream, system.text.encoding.utf8))             {                 string line;                 while((line = responsereader.readline()) != null)                 {                     if(line.contains("stop!"))                     {                         break;                     }                 }             }         }     } } 

this stop stream reading, response still whole page instead of "stop!" found.


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -

How to provide Authorization & Authentication using Asp.net, C#? -