I have an ASP.NET program where i am downloading a file from web using DownloadFile method of webClient Class and the do some modifications on it. then i am Saving it to ano
this may help....sorry its VB not C but hey...
This works
Dim fs As FileStream = Nothing fs = File.Create("H:\test.txt") fs.Close() File.Delete("H:\test.txt")
This doesn't, give "file being used by another process" error
File.Create("H:\test.txt") File.Delete("H:\test.txt")