日期:2014-05-18 浏览次数:20844 次
// 注册2个事件 private void textBox1_DragEnter(object sender, DragEventArgs e) { e.Effect = e.Data.GetDataPresent(DataFormats.FileDrop) ? DragDropEffects.Link : e.Effect = DragDropEffects.None; } private void textBox1_DragDrop(object sender, DragEventArgs e) { string[] paths = (string[])e.Data.GetData(DataFormats.FileDrop);// 文件路径数组 }