用 C# 编写剪贴板查看器

发布于 2024-07-30 20:15:11 字数 208 浏览 8 评论 0原文

我想编写一个学习词汇的程序。 只是每次,当我将一个单词复制到剪贴板时,它会将它们保存到文本文件中。

所以,有一个要求,我认为是:

  1. 我的程序像键盘记录器一样在后台运行?
  2. 每次我将单词复制到剪贴板时,检测偶数并将单词保存到文本文件中。

全部由C#完成。 所以,请给我一些建议! 非常感谢!

I want to write program to learn vocabulary. Simply each time, when I copy a word to clipboard, It will save them to text file.

so, there are requirements, I think that is:

  1. My program run in background like keylogger?
  2. Detect even and save words to text file everytime I copy a word to clipboard.?

all done by C#.
so, plz give me some advice! thank you very much!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

拔了角的鹿 2024-08-06 20:15:11

.NET SDK 中有一个名为 ClipboardSpy 的示例。

这是一个例子:

static void Main(string[] args)
{
    while (true)
    {
        if (Clipboard.ContainsText())
        {
            string s = Clipboard.GetText();

            Console.WriteLine(s);

            Clipboard.Clear();
        }
    }
}

There's an example in the .NET SDK called ClipboardSpy.

Here's an example even:

static void Main(string[] args)
{
    while (true)
    {
        if (Clipboard.ContainsText())
        {
            string s = Clipboard.GetText();

            Console.WriteLine(s);

            Clipboard.Clear();
        }
    }
}
污味仙女 2024-08-06 20:15:11

检测偶数并将单词保存到文本中
每次我复制一个单词到文件
剪贴板。?

要检测剪贴板更改,请使用 SetClipboardViewer。< br>
以下是如何在 C# 中创建剪贴板查看器的说明:
使用 SetClipboardViewer 在 C# 中创建 Windows 剪贴板监视器

Detect even and save words to text
file everytime I copy a word to
clipboard.?

To detect clipboard changes use the SetClipboardViewer.

Here are instructions of how to create a clipboard viewer in C#:
Create a Windows Clipboard Monitor in C# using SetClipboardViewer

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文