My .NET code is overwriting file, I am getting "file is used by another process" exception. I want to identify the process which is using the file at the moment. I know there are some tools available in SYSteminternals.com. but i want to Identify the process by code. Any help would be much appreciated.