【发布时间】:2011-07-19 08:31:04
【问题描述】:
有没有人有任何通过 DRAG 和 DROP 上传多个图像的示例。现在我正在使用uploadify upload来上传多个图像并将其绑定到datalist。效果很好。
但现在我想将其转换为拖放,因此用户无需单击 btn 并选择文件,他/她只需选择图像并将其拖放即可上传并绑定到 datalist。
【问题讨论】:
-
感谢您的回答,但很抱歉您的回答对我不起作用...
有没有人有任何通过 DRAG 和 DROP 上传多个图像的示例。现在我正在使用uploadify upload来上传多个图像并将其绑定到datalist。效果很好。
但现在我想将其转换为拖放,因此用户无需单击 btn 并选择文件,他/她只需选择图像并将其拖放即可上传并绑定到 datalist。
【问题讨论】:
好吧,你需要一个 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";
}
【讨论】: