利用 C# 給 Windows 資源管理器注冊右鍵菜單(Windows Shell)(一):入門


前言

關於 SharpShell 

SharpShell makes it easy to create Windows Shell Extensions using the .NET Framework.

 

准備

1. 去 https://github.com/dwmkerr/sharpshell/releases   下載 ServerManager.zip、ServerRegistrationManager.zip

2. 移動到一個本地目錄,比如我這里是:C:\MyFiles\SharpShell\SharpShell_Tools_v2.7.2

3. 把  ServerRegistrationManager.exe 改為 srm.exe 放入 C:\MyFiles\SharpShell\SharpShell_Tools_v2.7.2

打開 ServerManager.exe

如圖:

 

點擊菜單欄的 File => Load Server

如圖:

打開我們自己編寫的 CountLinesExtension.dll 所在的目錄 

 打開 C:\MyFiles\SharpShell\CountLinesExtension_v2.7.2

如圖:

 

 

點擊 Test Server in Test Shell

如圖:

提前准備 Test Text.txt

如圖:

在 Test Shell 中找到 C 盤

如圖:

測試成功

如圖:

點擊菜單欄的 Server - Install

如圖:

安裝成功

如圖:

關閉 SharpShell Tools 后,在 C 盤 Test Txt 文件上右鍵

如圖:

統計文本文件的行數測試成功

如圖:

附錄

1. 安裝和卸載SharpShell服務器

https://github.com/dwmkerr/sharpshell/blob/master/docs/installing/installing.md

2. Nuget

https://www.nuget.org/packages/ServerRegistrationManager

3. .NET Shell Extensions - Shell Context Menus

https://www.codeproject.com/Articles/512956/NET-Shell-Extensions-Shell-Context-Menus

謝謝瀏覽!


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM