I would like to know whether it is possible to enumerate file handles in c#, maybe using Win32API? This is easily done for window and process handles, but it seems that it is not possible for file handles.
While some functionality is offered by NtQuerySystemInformation, this is being phased out and therefore it is not recommended to use such a method.
You can call sysinternal's Handle and parse the result, or write a file system driver (could be a multi-human-year effort and can't be done in C#)