public static List <FileApi> GetFiles(Process process) { List <Win32API.SYSTEM_HANDLE_INFORMATION> lstHandles = new List <Win32API.SYSTEM_HANDLE_INFORMATION>(); lstHandles = GetHandles(process); List <FileApi> lstFileHandles = new List <FileApi>(); foreach (Win32API.SYSTEM_HANDLE_INFORMATION hand in lstHandles) { try { FileApi file = new FileApi(hand); if (file.Name != null && file.Name != "") { lstFileHandles.Add(file); } } catch (Exception ex) { } } return(lstFileHandles); }
public static List<FileApi> GetFiles(Process process) { List<Win32API.SYSTEM_HANDLE_INFORMATION> lstHandles = new List<Win32API.SYSTEM_HANDLE_INFORMATION>(); lstHandles = GetHandles(process); List<FileApi> lstFileHandles = new List<FileApi>(); foreach (Win32API.SYSTEM_HANDLE_INFORMATION hand in lstHandles) { try { FileApi file = new FileApi(hand); if (file.Name != null && file.Name != "") { lstFileHandles.Add(file); } } catch (Exception ex) { } } return lstFileHandles; }