File IO ASP.NET

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi
I have a asp.net page which uploads a file and saves it to the server. All
objects are set to nothing.
The page will then allow users to delete the uploaded file, but I get an
error saying file is in use already. Why is it in use? when i have closed
the IO and set it to nothing?
 
Setting an object reference to Nothing has no efffect whatsoever on the
original object. An object reference in .Net is like a pointer. It points to
whatever you assign it to. If you assign it to nothing, it no longer points
to whatever it was pointing to before. .Net garbage collection handles the
cleanup of instances that are no longer referenced.

As to why the file is still in use, apparently you have not completely
released it. How are you opening it? Are you disposing all classes that
implement IDisposable?

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
We got a sick zebra a hat,
you ultimate tuna.
 
Back
Top