Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/281.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何在ExplorerBrowser中显示文件列表?_C#_Wpf_Windows Api Code Pack - Fatal编程技术网

C# 如何在ExplorerBrowser中显示文件列表?

C# 如何在ExplorerBrowser中显示文件列表?,c#,wpf,windows-api-code-pack,C#,Wpf,Windows Api Code Pack,我编写了一个算法,用于查找符合特定条件的文件。获取这些文件(FileInfo对象)后,如何在ExplorerBrowser控件中显示它们?我对Windows API代码包非常陌生。您可以使用Treeview显示它们,然后使用ProcessStartInfo打开所需的文件,以便: foreach(FileInfo file in objects) { treeView1.Nodes.Add(file.FullName); } 使用nodemouse

我编写了一个算法,用于查找符合特定条件的文件。获取这些文件(
FileInfo
对象)后,如何在
ExplorerBrowser
控件中显示它们?我对Windows API代码包非常陌生。

您可以使用Treeview显示它们,然后使用ProcessStartInfo打开所需的文件,以便:

foreach(FileInfo file in objects)
       {
          treeView1.Nodes.Add(file.FullName);
       }
使用
nodemouse后,单击以下按钮:

 private void treeView1_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
        {
            treeView1.SelectedNode = e.Node;
            string args = string.Format("/Select, {0}", treeView1.SelectedNode.Text);

            ProcessStartInfo process= new ProcessStartInfo("explorer.exe", args);
            System.Diagnostics.Process.Start(process);
        }

我很感激你的尝试,但这根本不能回答问题。