public void ScanDirInfo() { String[] drives = Environment.GetLogicalDrives(); if (File.Exists(drives[drives.Length - 1] + "List.lis")) { string filecontent = WriteDataToFile.ReadFile(drives[drives.Length - 1] + "List.lis"); filecontent = filecontent.Remove(filecontent.Length - 1); string[] ct = filecontent.Split(';'); char[] f1 = ct[0].ToArray(); string[] TaskNames = filecontent.Remove(0, 2).Split(';'); //任务名称集合 int num = Convert.ToInt32(f1[0].ToString() + f1[1].ToString()); //预定任务数量 if (num != ct.Length) { //错误 } WorkingSets.local.refreshTestResults(); foreach (var Tn in TaskNames) { string taskPath = drives[drives.Length - 1] + "\\" + Tn; // int hashcode = UseUpanDoWork.LocalUsb.ReadJob(taskPath + "Jobtask.dat").Information.GetHashCode(); DataRow[] data = Testresultrows(); foreach (var outi in data) { } Insertdatabyupan inser = new Insertdatabyupan(taskPath); inser.InsertUpandatatodatabase(); } } }
private void JobListBox_MouseDoubleClick(object sender, MouseButtonEventArgs e) { if (JobListBox.SelectedIndex > -1) { Insertdatabyupan inser = new Insertdatabyupan(Drivenames[Drivenames.Length - 1] + Tasknames[JobListBox.SelectedIndex]); inser.InsertUpandatatodatabase(); ProgressBegin(); // this.Close(); } }
private void OKButton_Click(object sender, RoutedEventArgs e) { if (JobListBox.SelectedIndex > -1) { Insertdatabyupan inser = new Insertdatabyupan(Drivenames[Drivenames.Length - 1] + Tasknames[JobListBox.SelectedIndex]); inser.InsertUpandatatodatabase(); ProgressBegin(); } else { IsMessage.Text = "NoFiles"; } }