0

Hi all,
I have a problem while deleting xml File.
In detail i have generated xml file with encrypted format.
now when i am importing this file with decryption all data read and inserted to database using dataset. Record inserted successfully but when all process completed i want to delete the decrypted file using
system.IO.file.delete(strpath);
it can't be deleted shows error message file is used by another process.
Can anybody help me its urgent..

Thanks in advance..

4
Contributors
3
Replies
4
Views
6 Years
Discussion Span
Last Post by samueal
0

That means that this file is opened. An because it is opened, it means that it is used by another process.
You will have to close it down, and then you can do (execute) your code.
Check doube times if file is in use or not (but I am sure it is in use atm).

0

I guess so you have used FileStream for reading the XML file. If so, Close that Filestream..

Filestreamobject.Close();
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.