通常人们使用
Shell32.dll
获取回收站中文件列表。private static IEnumerable<string> GetRecycleBinFilenames()
{
const int ssfBitbucket = 10;
Type t = Type.GetTypeFromProgID("Shell.Application");
dynamic shell = Activator.CreateInstance(t);
Folder recycleBin = shell.NameSpace(ssfBitbucket);
foreach (FolderItem2 recfile in recycleBin.Items())
{
yield return recfile.Path;
}
Marshal.FinalReleaseComObject(shell);
}
我正在挂载一个VHDX文件,并希望从已挂载的外部磁盘/卷中获取回收站中的文件列表。我该如何操作?