using System; using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace OTSIncAReportApp._1_UI.OTSTemplateDesigner { public partial class FileNameSelect : Form { string folderPath = ""; string PathName = ""; public string ChangePathName = ""; public bool yes = false; Hashtable table; public FileNameSelect(string a_Route, string a_PathName) { folderPath = a_Route; PathName = a_PathName; ChangePathName = a_PathName; InitializeComponent(); #region 国际化语言 OTSCommon.Language lan = new OTSCommon.Language(this); table = lan.GetNameTable(this.Name); #endregion } private void FileNameSelect_Load(object sender, EventArgs e) { listView1.View = View.Details; // 设置视图为Details以显示列标题和子项 listView1.FullRowSelect = true; // 允许整行选择 listView1.CheckBoxes = true; // 允许在项旁边显示勾选框 listView1.Columns.Add(table["file_name"].ToString(), 229); // 添加列标题 // 获取文件夹中的所有文件信息 FileInfo[] files = new DirectoryInfo(folderPath).GetFiles("*.xml", SearchOption.AllDirectories); // 遍历文件信息数组并打印出文件名 foreach (FileInfo file in files) { listView1.Items.Add(file.Name); } for(int i=0;i