Click here to Skip to main content
15,891,253 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i accomplished file saving on Remote drive after saving one file i tried to save another file and it throws error as --> The process cannot access the file '\\server\share' because it is being used by another process.Please suggest solution for this issue
Posted

That means the resources which you have used for File operation has not yet been disposed.
In your code, after each file operation, try to dispose the object.

But now you have to go that drive and check the Task Manager. Locate your process which is running.
Close that or End that process and then execute your code, it should work. Make sure that you are disposing the File objects in your code.
 
Share this answer
 
Comments
shriti 3 16-Dec-13 2:17am    
Yes im disposing objects in my code


FileInfo FI = null;
System.IO.FileStream FS = null;
FI = new System.IO.FileInfo(networkPath);
FS = FI.Create();
FS.Write(objDoc.DocBytes, 0, objDoc.DocBytes.Length);
FS.Close();
FS.Dispose();
Did you check the Task Manager to see the process still running or not?
Resolved . Actually the network path to which im adding new file is kept in If Exists Directory.

Thanks for the help!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900