将文件从 TrueCrypt 卷复制到剪贴板?
我使用此代码将文件复制到剪贴板:
IDataObject data = new DataObject();
data.SetData(DataFormats.FileDrop, new string[] {@"X:\test.doc"});
MemoryStream memo = new MemoryStream(4);
byte[] bytes = new byte[] { (byte)(5), 0, 0, 0 };
memo.Write(bytes, 0, bytes.Length);
data.SetData("Preferred DropEffect", memo);
Clipboard.SetDataObject(data);
不幸的是,如果磁盘是 TrueCrypt 安装卷,则此方法不起作用。在 TrueCrypt 卷上执行此操作的方法是什么?
I use this code to copy files to Clipboard:
IDataObject data = new DataObject();
data.SetData(DataFormats.FileDrop, new string[] {@"X:\test.doc"});
MemoryStream memo = new MemoryStream(4);
byte[] bytes = new byte[] { (byte)(5), 0, 0, 0 };
memo.Write(bytes, 0, bytes.Length);
data.SetData("Preferred DropEffect", memo);
Clipboard.SetDataObject(data);
Unfortunately, this doesn't work if the disk is a TrueCrypt mounted volume. What is the way to do this on a TrueCrypt volume?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不幸的是,我认为如果没有正确的 Shell ID 列表,您就无法摆脱困境,在我的 Windows 7 上,您的代码甚至无法与常规文件系统一起工作。正确的代码首先会提供 CIDL:
其中
CreateShellIDList
创建所需 CIDA (CFSTR_SHELLIDLIST) 结构的二进制表示形式。实现如下:我不能把所有的功劳都归功于这里,我前段时间发现了这个 CIDA 代码,并将其移植到 c# 中。不太记得原始来源了,但到目前为止效果很好(我也刚刚在 TrueCrypt 上测试过)
Unfortunately, I do not think you can get away without a proper Shell ID list, on my Windows 7 your code doesn't even work with regular file system. The proper code would first and foremost provide a CIDL:
Where
CreateShellIDList
creates a binary representation of CIDA (CFSTR_SHELLIDLIST) structure needed. The implementation is below:I can't take all the credit here, I found this CIDA code some time ago and just ported it to c#. Can't really remember the original source but it works well so far (I just tested it on TrueCrypt as well)