你的位置:首页 > ASP.net教程

[ASP.net教程]c#拖放


 1 AllowDrop 2  3 DragEnter: 4  5 if (e.Data.GetDataPresent(DataFormats.FileDrop)) 6 e.Effect = DragDropEffects.Copy; 7 else e.Effect = DragDropEffects.None; 8  9 10 11 DragDrop12 13       Array anyFiles = ((System.Array)e.Data.GetData(DataFormats.FileDrop));14       for(int i = 0; i < anyFiles.Length; i++)15       {16         label1.Text+= anyFiles.GetValue(0).ToString()+"\n";17       }