C#实现文件拖放

1、设置Form的AllowDrop为true
2.

        private void Form1_DragDrop(object sender, DragEventArgs e)
        {
            MessageBox.Show(((System.Array)e.Data.GetData(DataFormats.FileDrop)).GetValue(0).ToString());   
        }

        private void Form1_DragEnter(object sender, DragEventArgs e)
        {
            if (e.Data.GetDataPresent(DataFormats.FileDrop))  e.Effect = DragDropEffects.Link;
            else e.Effect = DragDropEffects.None;   
        }