View Full Version : [C#] help file.close unhandled exception

11-05-2007, 07:46 AM
An unhandled exception of type 'System.IO.IOException' occurred in mscorlib.dll

Additional information: The process cannot access the file 'C:\Webdocs\xxx\xxx.xxx' because it is being used by another process.

hi all,

i`m doing an application to zip a file. this require system.io.file

but i`m having problem as it cannot run because the error above..
do i need to close the File.xxx as the library dont have the close function..

can anyone help?

11-05-2007, 11:12 PM
If you opened the stream, there is a close function. And you need to use it.

Post your code if you require more specific help so we can see what you are doing.

11-12-2007, 04:25 PM
I fixed my problem by suppressing the Finalize on the base stream after I opened the file

Here is the Line I added after opening the file

Then at the class destructor I could Flush and Close the file