ReignStumble Posted November 15, 2015 Share Posted November 15, 2015 Can anyone tell me why the code I made work when there is one file in D:\ but as soon as I have more than one file it crash... Here is the sourecode: http://pastebin.com/dteEXZHA Thanks ! Link to comment Share on other sites More sharing options...
0 Andre S. Veteran Posted November 16, 2015 Veteran Share Posted November 16, 2015 Well, you could just debug the program and find out (F5 or Debug -> Start Debugging); or at least see what exception is killing your program. Your program should only have one such statement: using (var stream = File.OpenRead(filename)) It currently has 3 and they're all nested, and you have a bunch of unused variables. Clean up the logic. Also, you call RunWorkerAsync in a loop without awaiting it. Bad bad bad. Probably the root cause of the issue. Either call the synchronous version or await it. Link to comment Share on other sites More sharing options...
Question
ReignStumble
Can anyone tell me why the code I made work when there is one file in D:\ but as soon as I have more than one file it crash...
Here is the sourecode:
http://pastebin.com/dteEXZHA
Thanks !
Link to comment
Share on other sites
1 answer to this question
Recommended Posts