在C#中发送密钥,发送:(Control + C)还是订单复制? [英] Send key in C#, send: (Control+C) or order copy?
本文介绍了在C#中发送密钥,发送:(Control + C)还是订单复制?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何命令Windows在C#中复制?复制任何选中的东西,就像发送Ctrl + C,或者如何在C#中发送Ctrl + C一样? Windows窗体应用程序
How to order Windows to copy in C#? copy any thing that is selected, just like sending Ctrl+C, or how to send Ctrl+C in C#? Windows Forms Applications
推荐答案
在C#中,不要命令Windows复制到剪贴板:而是使用剪贴板类 [ ^ ]将内容复制到其中:
In C#, you don't "order Windows to copy" to the clipboard: instead, you use the Clipboard class[^] to copy things onto it:
Clipboard.SetText(myTextBox.Text);
但是非常小心:如果您在用户不知情的情况下开始覆盖剪贴板内容,那么您的软件将非常非常有可能在极端偏见的情况下被卸载。许多人使用剪贴板很多,并且不要善意地覆盖他们的数据...
But be very careful: if you start overwriting the clipboard content without the user's knowledge, your software will stand a very, very good chance of being uninstalled with extreme prejudice. Many people use the clipboard a lot, and do not take kindly to you overwriting their data...
我做了,我用过:
http://inputsimulator.codeplex.com/ [ ^ ]
I did it, I used:
http://inputsimulator.codeplex.com/[^]
这篇关于在C#中发送密钥,发送:(Control + C)还是订单复制?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文