I am working on pdf creator in Asp.net with c#. In my code it created a pdf file and after that i use flush, close and dispost the streamwriter and in the nest function i am opening the same file in the next function i am opening this same file to show in browser pdf viewer. my pdf creation method is used threading and pdf reading function is in normal mode function.
My question is that how to check that this pdf file is use in another process in c# code? Because if i have created very small pdf file it will works fine but if i am creating a pdf file of 5-10 pages in that case it will throws error. i.e. the process cannot access the file because it is being used by another process
I want to use check the process monitor code on that file and how to explicitly kill that process?