File IO ASP.NET

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?
 
K

Kevin Spencer

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top