I have the following code:
using (MemoryStream str = new MemoryStream()) { Program.api.GetDocument(result, str); using (FileStream fileStream = File.Create(filePath)) { str.WriteTo(fileStream); } }
Whenever a file is written, it is always blocked subsequently - an attempt to delete or modify it causes Windows to tell me that the file is being used, even after closing my application. Did I miss something?
c # filestream memorystream
Chris
source share