Well, there is nothing in the documentations saying that it opens a file
as read only, so the name StreamReader may be misleading, and in fact, the
'path' may not even lead to a conventional file.
I would not say it was a bug, though it may have been unintentional, or
intentional as maybe having it read only as default may cause other
problems.
On Thu, 17 Mar 2005 14:15:10 +0100, cody <de********@gmx.de> wrote:
Change your StreamReader constructor to
StreamReader sr = new StreamReader(File.OpenRead(path));
If you also need to save data to the file, you could store all data in
memory while processing and try to obtain write access later.
Yes this would certainly solve the problem but it is really a bug in the
StreamReaderclass, is it? Iam using the following ctor:
StreamReader(string,Encoding).
--
Happy Coding!
Morten Wennevik [C# MVP]