百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
S

SharpClipboard

> 开发工具
开源

一个用于匿名监控剪贴板条目的库。

197 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

一个用于匿名监控剪贴板条目的库。

SharpClipboard

SharpClipboard is a clipboard-monitoring library for .NET that listens to the system's clipboard entries, allowing developers to tap into the rich capabilities of determining the clipboard's contents at runtime.

Here's a screenshot and below a usage-preview of the library's features:

Installation

To install via the NuGet Package Manager Console, run:

Install-Package SharpClipboard

Features

  • Supports .NET Framework 2.0 and above plus .NET Core.
  • Built as a component making it accessible in Design Mode.
  • Silently monitors the system clipboard uninterrupted; can also be disabled while running.
  • Provides support for multi-instance clipboard monitoring.
  • Ability to detect clipboard content in various formats: text, images, files, and other complex types.
  • Option to control the type of content to be monitored, e.g. text only, text and images only.
  • Ability to capture the background application's details from where the clipboard's contents were captured.

Usage

If you prefer working with the Designer, simply add the library to Visual Studio's Toolbox and use the Properties window to change its options:

To use it in code, first import WK.Libraries.SharpClipboardNS - the code below will then assist you:

…

You can also get the details of the application from where the clipboard's contents were cut/copied from using the ClipboardChanged argument property SourceApplication:

csharp
    private void ClipboardChanged(Object sender, SharpClipboard.ClipboardChangedEventArgs e)
    {
        // Gets the application's executable name.
        Debug.WriteLine(e.SourceApplication.Name);
        // Gets the application's window title.
        Debug.WriteLine(e.SourceApplication.Title);
        // Gets the application's process ID.
        Debug.WriteLine(e.SourceApplication.ID.ToString());
        // Gets the application's executable path.
        Debug.WriteLine(e.SourceApplication.Path);
    }

This option could come in handy especially when you're building a clipboard-monitoring application where users may feel the need to know where every recorded cut/copy action occurred.

To manually parse the content after a cut/copy has been detected, you can use the argument property e.Content in the ClipboardChanged event:

csharp
    private void ClipboardChanged(Object sender, ClipboardChangedEventArgs e)
    {
        // For texts...
        string text = e.Content.ToString();

        // or images...
        Image img = (Image)e.Content;

        // or files...
        List files = (List)e.Content;
		
        // or other complex types too.
        // Person p = JsonConvert.DeserializeObject(e.Content);
    }

Made with by Willy Kimura | Like to say thank you? Star this project. Feel free to BuyMeACoffee also.

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

C#clipboardclipboard-historyclipboard-managementclipboard-manager

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类开发工具
定价开源

> 相关工具

V
VS Code
流行的开源代码编辑器
G
Git
分布式版本控制系统
V
Vite
下一代前端构建工具