110,534
社区成员
发帖
与我相关
我的任务
分享
private void EnumOpenedFolder()
{
this.OpenedFolder.Clear();
Shell shell = new ShellClass();
IShellWindows windows = shell.Windows() as IShellWindows;
foreach (IWebBrowserApp app in windows)
{
if (app.LocationURL.StartsWith("file://"))
{
this.OpenedFolder.Add(app.LocationURL);
}
}
}
楼主可以用reflecter研究研究
catch (IOException)
{
MessageBox.Show("File is open or is used by another process.", "Warning",
MessageBoxButton.OK, MessageBoxImage.Warning);
}