简体   繁体   中英

Drag Drop to the Desktop after creation of the file? (C#)

I have a query about drag-drop in C# using .NET.

My issue is with remote files. I have a list of remote files which the user can drag into an explorer window (desktop, etc). When such a drag occurs I want to be able to download the file and write it to the drop location.

The normal method of dragging files:

private void StartDragDrop(string FileToDrag)
{
MyControl.DoDragDrop(new DataObject(DataFormats.FileDrop, FileToDrag), DragDropEffects.Copy);
}

...does not suit my needs as I will not have the file data to populate the drag-drop object until after the DROP.

I have seen this functionality in many FTP clients and such.

Thanks in advance wizards.

It appears there is no logically straight forward method to do such a thing.

But there is a work around (with a substantial amount of work for such basic functionaliy) that can be found at codeproject .

If anyone finds a tidy way of doing it, let me know, I'd be intrigued.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM