Quantcast
Channel: File locks when using file.move in c#...how can I stop or fix this - Stack Overflow
Browsing all 3 articles
Browse latest View live

Answer by Developer63 for File locks when using file.move in c#...how can I...

I had a similar situation with XML results files, produced by the xUnit console runner. I'm adding it as an answer here in case it helps others find the cause/solution when the StreamReader is in the...

View Article



Answer by SLaks for File locks when using file.move in c#...how can I stop or...

You should close your StreamReader and StreamWriter in using statements, like this:String tempFile = Path.GetTempFileName(), read = "";using(TextReader pending = new...

View Article

File locks when using file.move in c#...how can I stop or fix this

Code: String tempFile = Path.GetTempFileName(), read = ""; TextReader pending = new StreamReader("c:\\pending.txt"); TextWriter temp = new StreamWriter(tempFile); read = pending.ReadLine(); while...

View Article
Browsing all 3 articles
Browse latest View live




Latest Images