2011-07-19 73 views
0

有沒有人有任何通過DRAG和DROP上傳多個圖像的例子。目前,我正在使用uploadify上傳來上傳多張圖片並將其綁定到datalist中。它工作得很好。如何將uploadify上傳爲上傳圖片的拖放功能?

但現在我想將其轉換爲拖放,因此用戶不必點擊btn並選擇文件,他/她只需選擇圖像並拖放它,然後將其上傳並綁定到datalist中。

+0

感謝您的答,但我很抱歉,你答不工作對我來說... – Rocky

回答

0

那麼,你需要一個DragDrop事件集,把下面的代碼:

void Form_DragDrop(object sender, DragEventArgs e) 
{ 
    // Extract the data from the DataObject-Container into a string list 
    string[] FileList = (string[])e.Data.GetData(DataFormats.FileDrop, false); 

    // Do something with the data... 

    // For example add all files into a simple label control: 
    foreach (string File in FileList) 
     this.label.Text += File + "\n"; 
} 
+0

我想使我的圖像上傳像http://krystalware.com/slickupload/demos例子 – Rocky