我是否应该担心将大量数据放入 Windows 剪贴板?
如果您在剪贴板上有大量内容(例如整个 Word 文档)时尝试关闭 Microsoft Office 应用程序,它会提示您询问是否要在应用程序关闭后访问该数据。
在当今时代,如果我在剪贴板上说了 10MB 的内容,真的很重要吗?
当我编写图像处理应用程序时,我应该遵循与 Office 相同的规则,还是直接忘记它并将数据保留在那里?
If you try to close a Microsoft Office application when you've got a ton of its stuff on the clipboard (e.g. a whole word doc), it prompts you to ask if you would like to access that data after the application is closed.
In this day and age, does it really matter if I have say 10MB of stuff on the clipboard?
As I write my image processing app, should I follow the same rule as Office, or just forget about it and leave the data there?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
就我个人而言,我赞成忘记它并将其留在那里。 我一直觉得 MS Word 方法烦人多于有用。
Personally, I favor just forgetting about it and leaving it there. I've always found the MS Word approach more annoying than useful.
单词询问此问题的原因是它使用 剪贴板延迟渲染。 这允许 Word 仅创建粘贴操作时请求的格式。 但是,如果程序退出而不渲染它们,则剪贴板上通过延迟渲染创建的任何格式都会消失。 就 Excel 而言,在 RTF 中渲染数千个空单元格将占用兆字节的空间,即使实际数据很小。 因此,它会询问您是否希望将数据呈现到剪贴板,或者您是否愿意丢失它。
对于您自己的应用程序,问题就变成:我应该使用延迟渲染吗? 答案取决于以您想要支持的各种格式进行渲染需要多长时间。 如果您只支持一种快速渲染的格式,那么延迟渲染很可能不会有任何优势。
The reason word is asking about this is that it uses Delayed Rendering for the clipboard. This allows word to only create the formats that are requested upon a paste operation. However, any formats on the clipboard that were created with delayed rendering will disappear if the program exits without rendering them. In the case of excel, rendering thousands of empty cells in RTF would take megabytes of space, even though the actual data is tiny. Thus it asks whether you want the data rendered to the clipboard or if you're fine with losing it.
For your own application, the question then becomes: should I use delayed rendering? The answer depends on how long it take you to render in the various formats you'd like to support. If you're only supporting one format that renders quickly, odds are there's not going to be an advantage to delayed rendering.
如果您在没有用户请求的情况下将内容存储在剪贴板上,那么您可能只会惹恼一些人:)
否则,是的,只需将数据留在那里即可。
If you're storing things on the clipboard without the user requesting it then you might just annoy a few people :)
Otherwise, yeah, just leave the data there.
如何删除 Windows 剪贴板数据
我猜想,今天的恶意软件也会在那里窥探。
这个问题可能更适合超级用户。
How To Erase Windows Clipboard Data and Why.
I'd guess, malware today would also be snooping there.
this question might be more suitable on superuser.