private void MainForm_DragDrop(object sender, DragEventArgs e) { var array = (Array)e.Data.GetData(DataFormats.FileDrop); string files = ""; foreach (object a in array) { string path = a.ToString(); files += path + " | "; } txbWLPath.Text = files.Remove(files.Length - 3); if (array.Length == 1) { cbxFrom.Text = FileOperationHelper.AutoMatchSourceWLType(array.GetValue(0).ToString()); } }
private void btnOpenFileDialog_Click(object sender, EventArgs e) { if (openFileDialog1.ShowDialog() == DialogResult.OK) { //this.txbWLPath.Text = openFileDialog1.FileName; string files = ""; foreach (string file in openFileDialog1.FileNames) { files += file + " | "; } txbWLPath.Text = files.Remove(files.Length - 3); if (cbxFrom.Text != ConstantString.SELF_DEFINING) { cbxFrom.Text = FileOperationHelper.AutoMatchSourceWLType(openFileDialog1.FileName); } } }