Back to General discussions forum
Got a problem with reading input data from streams. When I'm creating FileStream with FileMode.Open or OpenOrCreate with path, for example "data.txt" it just gives exception on compilation, while this code perfectly works in VS (had to test it elsewhere). Same goes for StreamReader. For example:
StreamReader sr = new StreamReader("data.txt"); or StreamReader sr = new StreamReader(new FileStream("data.txt", FileMode.Open));
Is it possible to work with streams? What am I doing wrong then? Should I just continue reading input with console functions?
Would be gratefull for any reply.
If you want to work with streams, you can just use VS to write programs, and then just paste code and answer to problem. And if you want your code to run in browser (executed in remote server) when you should continue using console functions
Ok, gotcha. Thanks for the answer.