WPF添加Drop事件 Drop="Window_Drop_1"
Winform添加DragDrop事件
private void Window_Drop_1(object sender, DragEventArgs e) { if (e.Data.GetDataPresent(DataFormats.FileDrop)) e.Effects = DragDropEffects.Link; else e.Effects = DragDropEffects.None; string _filePath = ((System.Array)e.Data.GetData(DataFormats.FileDrop)).GetValue(0).ToString(); }