Reply to comment

Streaming a large file from the hard drive

This code above is interested in only downloading a file from the web.  To read in a large file from your hard drive such as a very large XML file, probably the best way to do this is using the FileStream object.  You can find out more about it here:

http://msdn.microsoft.com/en-us/library/system.io.filestream.aspx

This will allow you to stream the file in one character at a time.  Inside your loop that reads the file, you can update your progress bar and update your TreeView control.

NOTE: Make sure you are doing all of this streaming on a separate thread such as a background worker process.  That way, your UI will update.  If you run this streaming on your main thread, you will not see the progress bar or any other UI update and it will appear to "hang" until your file is completely streamed in.

Reply