I need to create a result file based on a template doc file, just like your demo did.
But there are more than one people to do this at same time, so my solution is to copy the original template file to a individual folder, then open it with Spire.Doc, insert some content, and save it.
- Code: Select all
Document document = new Document("test.doc");
//something here
document.Close();
This works fine.
After this, I need to delete the test.doc.
- Code: Select all
FileInfo cachfile = new FileInfo("test.doc");
cachfile.Delete();
But an error is raised:
The process cannot access the file 'XX:XX\XX\test.doc' because it is being used by another process.
I don't know why there is another process still using the file.
the
- Code: Select all
document.Close();
has been excuted.
In general, how to delete a file just be used by Spire.Doc?
yours,
Ivan