Hi Guys.....
I need help , I want to know Process Name which is using a file.
Ex. I want to know file ABC.txt is opened by which Process.
Actually i want this because, I am doing Continuous Printing , the steps I am doing is following
STEP1 : Checking If Rich1.txt Exist or not if Yes, then I am deleting it first , then Creating new txt with Name Rich1.txt
Step 2: Now writing characters using streamwriter. After writing Characters i am closing Closing streamwriter
Step3 After writing Rich1.txt Sending it to RawPrinter(Printer)
But the Real Problem is that when i Do continuous Printing (One after One)
then first time it is Printing ok , But when it comes for second time
then it is throwing exception at step1 that C:\Rich1.txt is used by another Process
I am unable to konow which process is using it . I look in Taskmanager for notepad.exe ( because .txt is opened by notepad ) but i not got.
Any Help is Welcome.....!