拖放和剪贴板 [英] Drag and drop and the clipboard
问题描述
我有一个Windows应用程序,它会在启动拖动操作时将一些文本数据放到剪贴板上。我还有一个C#asp.net网页,它需要响应一个drop事件并解释剪贴板上的内容。
从研究中我已经开始检测到下降似乎很容易(''只是'一些javascript)但是网页访问存在复杂性剪贴板,例如安全性和浏览器特定的问题。
这里有没有人有这种情况的经验?
请注意,我无法更改Windows应用程序,但我可以在网站上添加代码。
Hi,
I have a windows application which puts some text data onto the clipboard when a drag operation is initiated. I also have a C# asp.net web page which needs to respond to a drop event and interpret what''s on the clipboard.
From the research I''ve already carried out detecting the drop seems quite easy (''just'' some javascript) but there are complications with a web page accessing the clipboard, such as security and browser specific problems.
Has anyone here had any experience with this kind of scenario?
Note that I can''t change the windows application but I can add code to the website.
推荐答案
window.clipboardData.getData(''文本'')显然适用于IE,但没有其他浏览器。只要drop只是text,并且可能会提示用户,就像你希望的那样。
window.clipboardData.getData(''Text'') apparently works in IE, but no other browser. So long as the drop is text only, and the user will probably be prompted, as you would hope.
这篇关于拖放和剪贴板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!