C# 剪贴板查看器...在 Firefox 上该事件触发两次
我正在尝试使用此处发布的代码 剪贴板事件 C#
它确实工作得很好,但是在测试时,我发现从某些应用程序复制时以 Firefox 为例,您将使该事件运行两次,因此,如果您将复制的文本保存到文本文件,或将它们写入应用程序中的文本框,从 Firefox 复制的文本将出现两次?
有人可以帮我解决这个问题吗? 多谢
iam trying to use the code posted here
Clipboard event C#
it does work really great, but while testing, i found out that when copying from some application as example firefox, you will get the event running twice, so if you are saving the copied text to a textfile, or writing them to a textbox in the application, the text copied from firefox will appear twice ?
anybody can help me with this problem ?
thanks a lot
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
存储最后的输入,如果新的输入与最后的输入相同,则丢弃 ?
Store the last input, and if the new input is the same as the last, discard ?
在“裸”系统上尝试一下,以确保您不会在某处收到“回声”。应该只有一个通知。但是,如果事件期间有其他事情改变了剪贴板,您可以获得两个。例如,剪贴板驱动的文本洗涤器。
如果执行复制的应用程序出错,您还可以获得多个事件。例如,当应用程序打开/关闭每种数据格式的剪贴板时(他们不应该这样做,如果这样做的话,这就是一个错误)。尝试从普通的旧记事本进行复制,看看您是否“听到”该事件两次。
Try it on a "bare" system to ensure that you aren't getting an "echo" somewhere. There should only be one notification. However, if soemthing else alters the clipboard during the event, you can get two. For example, a clipboard-driven text scrubber.
You can also get multiple events if the app doing the copying does it wrong. Such as when apps open/close the clipboard for each data format (they should not, this is a bug if they do). Try copying from plain old Notepad and see if you "hear" the event twice or not.
FF里有运行的插件吗?听起来你确实是这样的。在带有全新 FF 的“裸”系统上尝试一下,仅此而已。
Do you have any plug-ins runnign within FF? It sounds like you do. Try it on a "bare" system with brand-new FF and nothing else.