//光谱融合初始化函数重载 public QuaAssShowForm(SpecQuaAssForm vSpecQuaAssForm) : this() { this.vSpecQuaAssForm = vSpecQuaAssForm; //初始化评价影像下拉菜单 List <string> cbxString = new List <string>(); int nFiles = vSpecQuaAssForm.sGlobal_Filename_Ass.Count(); for (int i = 0; i < nFiles; i++) { string tempstr = Path.GetFileNameWithoutExtension(vSpecQuaAssForm.sGlobal_Filename_Ass[i]); string tempstr2 = vSpecQuaAssForm.sGlobal_OutDir + tempstr + "_" + vSpecQuaAssForm.sGlobal_QuaKindEn + ".txt"; cbxString.Add(tempstr2); } this.comboBox.DataSource = cbxString; this.comboBox.SelectedIndex = 0; //初始化listBox this.listBox.Items.Clear(); StreamReader objReader = new StreamReader(cbxString[0]); string sLine = string.Empty; int n; ArrayList linlist = new ArrayList(); while (sLine != null) { sLine = objReader.ReadLine(); if (!string.IsNullOrEmpty(sLine)) { linlist.Add(sLine); } } objReader.Close(); n = linlist.Count; for (int i = 0; i < n; i++) { string str = linlist[i].ToString(); listBox.Items.Add(str); } }
private void btn_SpecQuaAss_Click(object sender, EventArgs e) { SpecQuaAssForm vSpecQuaAssForm = new SpecQuaAssForm(fMai); vSpecQuaAssForm.Show(); }