using System; using System.Collections.Generic; using System.Data; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Shapes; namespace formula_manage.EX { /// /// Exchange.xaml 的交互逻辑 /// public partial class Exchange : Window { string Log_time = DateTime.Now.ToString("yyyy-MM-dd"); DataTable logdataTable = new DataTable(); //建立log缓存 public Exchange() { InitializeComponent(); logdataTable.Columns.Add("Name", typeof(string)); logdataTable.Columns.Add("length", typeof(int)); LOG_file(); } private void LOG_file()//建立列表 { DirectoryInfo loginfo = new DirectoryInfo(System.Environment.CurrentDirectory + "\\Exchange"); //new文件夹 FileInfo[] logFile = loginfo.GetFiles("*.log");//生成文件夹中的文件名合集 // logdataTable.ItemsSource = logFile;//加载合集 // logFile.fill() //gridLog.DisplayMemberPath = "Name"; // 显示文件名 } } }