确定所有开放系统/特殊文件夹

问题描述:

我目前使用下面来获取所有打开资源管理器窗口的路径:

I am currently using the following to Get Path of all Open Explorer Windows:

foreach (SHDocVw.InternetExplorer j in new SHDocVw.ShellWindows()) {
    if (j.Name == "Windows Explorer") {
        ListView1.Items.Add(j.LocationURL);
    }
}

不过,这并不返回如电脑,回收站,网络等特殊文件夹的位置,有没有一种方法来识别这些文件夹,所以我可以把路径上自己喜欢外壳:MyComputerFolder 计算机?

如果 j.LocationName 我与当前系统文件夹的名字进行了比较:获得Windows特殊文件夹的当前名称,然后添加的路径手动像外壳:MyComputerFolder

If j.LocationName was null I compared it with the current system folders' name : Get Current Names of Windows Special Folders, then added the path manually like shell:MyComputerFolder