我有一个用 C# 编写的文档控制系统。 从 Outlook 拖放到 C# 已经完成了一段时间。现在许多文件都在 C# 应用程序中,用户自然希望能够从我的另一个方向拖放文档控制系统到 Outlook。
由于文件存储在文件系统中(而不是作为 SQL 数据库中的 blob),我让它们打开文件夹 View 并从那里拖放。但是,这允许绕过文档管理系统的版本控制。
我可以构建一条拖放消息来通知 Outlook 我要放置的文件名和路径吗?我怀疑这已经完成,但我的搜索量被相反方向的回复数量淹没。
最佳答案
从这里开始:
http://social.msdn.microsoft.com/Forums/en-US/winforms/thread/f57ffd5d-0fe3-4f64-bfd6-428f58998603/
//put the file path is a string array
string[] files = new String[1];
files[0] = @"C:\out.txt";
//create a dataobject holding this array as a filedrop
DataObject data = new DataObject(DataFormats.FileDrop, files);
//also add the selection as textdata
data.SetData(DataFormats.StringFormat, files[0]);
//do the dragdrop
DoDragDrop(data, DragDropEffects.Copy);
关于c# - 从 C# 拖放到 Outlook,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10541004/