一、ILSPY簡介
1.1、ILSPY介紹
ILSPY是一款開源、免費的、且適用于.NET平臺反編譯【C#語言撰寫的程式和庫(.dll)內容】工具;可以集成在Visual Studio 開發工具中,能夠十分快捷方便的查看源代碼內容,
1.2、ILSPY使用方法
在專案中選中需要查看的方法,然后右鍵選擇【用ILSPy打開代碼】即可查看源代碼內容,


1.3、ILSpy 7.1的安裝包和壓縮包
ILSpy安裝包和壓縮包下載
https://download.csdn.net/download/xiaochenXIHUA/34627586
二、給Visual Studio 2019安裝ILSpy工具
2.1、下載安裝到Visual Studio 2019上的ILSpy反編譯工具
ILSpy - Visual Studio Marketplace
https://marketplace.visualstudio.com/items?itemName=SharpDevelopTeam.ILSpy#Overview
2.2、安裝反編譯工具ILSpy工具到Visual Studio 2019中
①首先關閉Visual Studio 2019、和其打開的所有專案,
②雙擊下載好的【ILSpy.AddIn.vsix】包檔案,按照提示安裝好即可,
![]()
③打開Visual Studio 2019專案,選擇任意方法點擊滑鼠右鍵-->選擇【用ILSPy打開代碼】即可查看原始碼,

2.3、給【用ILSPy打開代碼】添加快捷鍵
①比如這里給【用ILSpy打開代碼】添加快捷鍵【Ctrl+3】的操作步驟如下:
選擇【工具】-->【選項】-->【環境】-->【鍵盤】-->【輸入:ILSpy】-->選中【編輯器背景關系選單.代碼視窗.用ILSpy打開代碼】-->【同時按下鍵盤的:Ctrl+3】-->點擊【分配】按鈕-->點擊【確定】按鈕即可


②驗證【用ILSpy打開代碼】添加快捷鍵【Ctrl+3】是否成功(兩種方法)
《1》選中方法,然后同時按下【Ctrl+3】能夠打開界面查看源代碼表示成功;打開如下圖片表示成功,

《2》選中一個方法查看【用ILSpy打開代碼】右邊是否存在【Ctrl+3】則成功,如下圖所示:

三、直接使用ILSpy工具反編譯查看源代碼
3.1、下載ILSpy工具的壓縮包
①打開ILSpy的官網
ILSpy - Visual Studio Marketplace
https://marketplace.visualstudio.com/items?itemName=SharpDevelopTeam.ILSpy#Overview
②下載ILSpy工具的壓縮包
Release ILSpy 7.1 · icsharpcode/ILSpy · GitHub
https://github.com/icsharpcode/ILSpy/releases/tag/v7.1


③解壓后打開【ILSpy.exe】即可使用

四、其他反編譯工具
.NET Reflector Visual Studio Extension - Visual Studio Marketplace
https://marketplace.visualstudio.com/items?itemName=vs-publisher-306627.NETReflectorVisualStudioExtension
.NET Decompiler: Decompile Any .NET Code | .NET Reflector (red-gate.com)
https://www.red-gate.com/products/dotnet-development/reflector/
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/339113.html
標籤:其他
