I get an IOException with ERROR_SHARING_VIOLATION = 32, and I want get the full path file is "locked".
var ioex = ex as IOException;
var err = System.Runtime.InteropServices.Marshal.GetLastWin32Error();
if (err == 32) Trace.WriteLine("It's locked");
The exception message can be in several languages:
The process cannot access the file 'C:\Users\mj.PG\Documents\IssuedLetter\3.PDF' because it is being used by another process.
El proceso no puede obtener acceso al archivo '\xxxx.es\xxxxx\Campañas SVT\Campaña zzzz\Coordinacion\4_ESTADISTICAS\2021\05_mayo\Informes Servicio zzzz\Informe Acumulado\Informe Acumulado 05_05_2021.xlsx' porque está siendo utilizado en otro proceso.
How-to get the full path file without use the string?