Is there a way to read from a website, one line at a time?

c#

Solution

Don't download the url as a string, read it as a stream.

using System.IO;
using System.Net;

var url ="http://thebnet.x10.mx/HWID/BaseHWID/AlloweHwids.txt";
var client = new WebClient();
using (var stream = client.OpenRead(url))
using (var reader = new StreamReader(stream))
{
    string line;
    while ((line = reader.ReadLine()) != null)
    {
        // do stuff
    }
}

Problem

I have this code: ``` string downloadedString; System.Net.WebClient client; client = new System.Net.WebClient(); downloadedString = client.DownloadString( "http://thebnet.x10.mx/HWID/BaseHWID/AlloweHwids.txt"); ``` It's a HWID-type security (it will check your HWID to see if you are allowed to use the program) Anyway, I want to be able to put multiple lines on it at a time, example: ``` xjh94jsl <-- Not a real HWID t92jfgds <-- Also not real ``` And be able to read each line, one by one, and update it to downloadedString.

Original source