Link to home
Start Free TrialLog in
Avatar of stormist
stormist

asked on

Is it possible to save a remote txt file as a memory stream instead of a file?

i.e. http://www.example.com/example.txt saved direct into a memory stream
ASKER CERTIFIED SOLUTION
Avatar of drichards
drichards

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of stormist
stormist

ASKER

drrichards, thank you for your reply. How would I go about using the response stream directly, assuming I wanted to process it line by line?
You can just wrap it in a StreamReader:

    StreamReader rdr = new StreamReader(response.GetResponseStream());
    // Read line by line - in a loop, for example
    string line = rdr.ReadLine();
    // loop until line is null