企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持知识库和私有化部署方案 广告
``` FolderBrowserDialog fbdlg = new FolderBrowserDialog(); fbdlg.Description = "请选择文件路径"; if (fbdlg.ShowDialog() == DialogResult.OK) { string foldPath = fbdlg.SelectedPath; textBox1.Text = foldPath; return; DirectoryInfo theFolder = new DirectoryInfo(foldPath); FileInfo[] dirInfo = theFolder.GetFiles(); //遍历文件夹 foreach (FileInfo file in dirInfo) { MessageBox.Show(file.ToString()); } } ```