吾爱破解 - 52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 929|回复: 8
上一主题 下一主题
收起左侧

[已解决] C#注册系统右键菜单的代码该怎么修改?

[复制链接]
跳转到指定楼层
楼主
zhanglei1371 发表于 2023-6-17 07:48 回帖奖励
本帖最后由 zhanglei1371 于 2023-6-20 05:13 编辑

各位,我想实现一个类似rar右键菜单的功能,于是就找了个demo,网址是这个:
(C#)Windows Shell 外壳编程系列7 - ContextMenu 注册文件右键菜单 - 柠檬隐士 - 博客园  https://www.cnblogs.com/lemony/archive/2008/08/29/1279588.html
在VS2019下可以正常编译,也能成功的注册到右键。
效果如下:

但是现在的问题是:
点击复制路径却没有任何反应。
查阅很多资料也没有修改成功。
希望各位大佬能指点下这个该怎么修改。
关键代码就是这个地方:
[Asm] 纯文本查看 复制代码
                       
 void IContextMenu.InvokeCommand(IntPtr pici)
        {
            INVOKECOMMANDINFO ici = (INVOKECOMMANDINFO)Marshal.PtrToStructure(pici, typeof(ShellLib.INVOKECOMMANDINFO));
            StringBuilder sb = new StringBuilder(1024);
            StringBuilder sbAll = new StringBuilder();
            uint nselected;
            switch (ici.verb)
            {
                
                case 0:
.........


谢谢各位。【抱歉发现发错版块了,应该是编程语言求助区,不知道怎么挪】
附件:
https://wwi.lanzoup.com/ii56H0zc3zwd
谢谢!

发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。

沙发
不知道改成啥 发表于 2023-6-17 11:00
你这哪是C#是VB啊
3#
cdj68765 发表于 2023-6-17 11:30
下面是我以前写的一个项目里面用到的代码,用来实现你说的的功能,有一点儿复杂,有问题直接来问我
[C#] 纯文本查看 复制代码
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Runtime.InteropServices.ComTypes;
using System.Text;
using System.Windows.Forms;
using static ETCTool.NativeApi;
using IDataObject = System.Runtime.InteropServices.ComTypes.IDataObject;

namespace ETCTool
{
    [ClassInterface(ClassInterfaceType.None)]
    [Guid("B3F0615C-D04E-41DC-A1EB-4E8B8DCC14A1")]
    [ComVisible(true)]
    public class FileContextMenuExt : IShellExtInit, IContextMenu
    {
        private readonly List<NativeApi.MenuItem> ContextItems = new List<NativeApi.MenuItem>();

        //用于记录文件数量
        private List<string> FilePath = new List<string>();

        public FileContextMenuExt()
        {
            ContextItems.Add(new NativeApi.MenuItem("EtcTool", true, null,
                ICO.ICO.System_preferences_tool_tools_128px_581754_easyicon_net1.GetHbitmap(), ""));
            ContextItems.Add(new NativeApi.MenuItem("解密打开", true, null, ICO.ICO.Start1.GetHbitmap(), "Open"));
            ContextItems.Add(new NativeApi.MenuItem("解密复制", true, null, ICO.ICO.button_purple1.GetHbitmap(),
                "Copy"));
            ContextItems.Add(new NativeApi.MenuItem("原地解密", true, null, ICO.ICO.circle_yellow1.GetHbitmap(),
                "Decrypt"));
        }

        //注册项目
        public int QueryContextMenu(IntPtr hMenu, uint iMenu, uint idCmdFirst, uint idCmdLast, uint uFlags)
        {
            /* new Mutex(true, "ETCTool", out var Close);
             if (!Close)
             {
                 FileDecryptMainFun.FileDecryptFun(false);
                 UpdateWindow(GetWindowDC(GetDesktopWindow(IntPtr.Zero)));
                 SHChangeNotify(HChangeNotifyEventID.SHCNE_ALLEVENTS, HChangeNotifyFlags.SHCNF_FLUSH, IntPtr.Zero, IntPtr.Zero);
                 return 0;
             }*/
            // If uFlags include CMF_DEFAULTONLY then we should not do anything.
            if (((uint)CMF.CMF_DEFAULTONLY & uFlags) != 0) return 0;

            // Add a separator.
            /*  var sep = new MENUITEMINFO();
              sep.cbSize = (uint)Marshal.SizeOf(sep);
              sep.fMask = MIIM.MIIM_TYPE;
              sep.fType = MFT.MFT_SEPARATOR;
              if (!InsertMenuItem(hMenu, 0, true, ref sep))
                  return Marshal.GetHRForLastWin32Error();*/

            // Register item 0: Submenu
            var hSubMenu = CreatePopupMenu();
            var item = ContextItems[0];
            RegisterMenuItem(0, idCmdFirst, item.Text, true, item.Bitmap, hSubMenu, 1, hMenu);
            // Register item 1: RunDefault
            item = ContextItems[1];
            RegisterMenuItem(1, idCmdFirst, item.Text, true, item.Bitmap, IntPtr.Zero, 0, hSubMenu);
            // Add a separator.
            /*  sep = new MENUITEMINFO();
              sep.cbSize = (uint)Marshal.SizeOf(sep);
              sep.fMask = MIIM.MIIM_TYPE;
              sep.fType = MFT.MFT_SEPARATOR;
              InsertMenuItem(hSubMenu, 1, true, ref sep);*/

            // Register item 2 (Submenu->ManageApp).
            item = ContextItems[2];
            RegisterMenuItem(2, idCmdFirst, item.Text, true, item.Bitmap, IntPtr.Zero, 2, hSubMenu);
            // Register item 3 (Submenu->ManageAll).
            item = ContextItems[3];
            RegisterMenuItem(3, idCmdFirst, item.Text, true, item.Bitmap, IntPtr.Zero, 3, hSubMenu);

            /*  sep = new MENUITEMINFO();
              sep.cbSize = (uint)Marshal.SizeOf(sep);
              sep.fMask = MIIM.MIIM_TYPE;
              sep.fType = MFT.MFT_SEPARATOR;*/
            return MAKE_HRESULT(0, 0, (uint)ContextItems.Count); //3个划线+4个项目

            int MAKE_HRESULT(uint sev, uint fac, uint code)
            {
                return (int)((sev << 31) | (fac << 16) | code);
            }

            int RegisterMenuItem(uint id,
                uint _idCmdFirst,
                string text,
                bool enabled,
                IntPtr bitmap,
                IntPtr subMenu,
                uint position,
                IntPtr registerTo)
            {
                var sub = new MENUITEMINFO();
                sub.cbSize = (uint)Marshal.SizeOf(sub);

                var m = MIIM.MIIM_STRING | MIIM.MIIM_FTYPE | MIIM.MIIM_ID |
                        MIIM.MIIM_STATE;
                if (bitmap != IntPtr.Zero)
                    m |= MIIM.MIIM_BITMAP;
                if (subMenu != IntPtr.Zero)
                    m |= MIIM.MIIM_SUBMENU;
                sub.fMask = m;
                sub.wID = _idCmdFirst + id;
                sub.fType = MFT.MFT_STRING;
                sub.dwTypeData = text;
                sub.hSubMenu = subMenu;
                sub.fState = enabled ? MFS.MFS_ENABLED : MFS.MFS_DISABLED;
                sub.hbmpItem = bitmap;

                if (!InsertMenuItem(registerTo, position, true, ref sub))
                    return Marshal.GetHRForLastWin32Error();
                return 0;
            }
        }

        //点击后命令回调
        public void InvokeCommand(IntPtr pici)
        {
            try
            {
                var Index = ContextItems[
                    LowWord(((CMINVOKECOMMANDINFO)Marshal.PtrToStructure(pici, typeof(CMINVOKECOMMANDINFO))).verb
                        .ToInt32())];
                if (FilePath.Count == 0) return;

                try
                {
                    var remoteDataHandle = (RemoteDataHandle)Activator.GetObject(typeof(RemoteDataHandle),
                        "ipc://EtcToolChannel/RemoteDataHandle");
                    switch (Index.Commands)
                    {
                        case "Open":
                            {
                                if (FilePath.Count != 1)
                                    remoteDataHandle.Info("只支持打开一个文件");
                                else
                                    remoteDataHandle.Open(FilePath.First());
                            }
                            break;

                        case "Copy":
                            {
                                remoteDataHandle.Copy(FilePath.ToArray());
                            }
                            break;

                        case "Decrypt":
                            {
                                remoteDataHandle.Decrypt(FilePath.ToArray());
                            }
                            break;
                    }
                }
                finally
                {
                }
            }
            catch (Exception e)
            {
                MessageBox.Show(e.Message);
            }

            GC.Collect();

            int LowWord(int number)
            {
                return number & 0xffff;
            }
        }

        public void GetCommandString(UIntPtr idCmd, uint uFlags, IntPtr pReserved, StringBuilder pszName,
            uint cchMax)
        {
        }

        //在注册菜单之前发生,用于获得各种数据
        public void Initialize(IntPtr pidlFolder, IntPtr pDataObj, IntPtr hKeyProgId)
        {
            if (pDataObj == IntPtr.Zero)
            {
                Variables.MainForm.OntherLog.Add(new[] { $"{DateTime.Now:hh:mm:ss}->发生未知错误在获得数据时", "" });
                return;
            }

            var fe = new FORMATETC
            {
                cfFormat = 15,
                ptd = IntPtr.Zero,
                dwAspect = DVASPECT.DVASPECT_CONTENT,
                lindex = -1,
                tymed = TYMED.TYMED_HGLOBAL
            };
            STGMEDIUM stm;
            var dataObject = (IDataObject)Marshal.GetObjectForIUnknown(pDataObj);
            dataObject.GetData(ref fe, out stm);
            try
            {
                var hDrop = stm.unionmember;
                if (hDrop == IntPtr.Zero) throw new ArgumentException();
                var nFiles = DragQueryFile(hDrop, 0xFFFFFFFF, null, 0); //获得选中文件数
                if (nFiles != 0)
                {
                    FilePath = new List<string>();
                    for (uint i = 0; i <= nFiles - 1; i++)
                    {
                        var fileName = new StringBuilder(1024);
                        if (DragQueryFile(hDrop,
                                i,
                                fileName,
                                fileName.Capacity) != 0)
                            FilePath.Add(fileName.ToString());
                    }
                }
            }
            finally
            {
                ReleaseStgMedium(ref stm);
            }
        }
    }

    #region 右键菜单的接口

    [ComImport]
    [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
    [Guid("000214e8-0000-0000-c000-000000000046")]
    internal interface IShellExtInit //接收explorer传递的信息
    {
        void Initialize(
            IntPtr /*LPCITEMIDLIST*/ pidlFolder,
            IntPtr /*LPDATAOBJECT*/ pDataObj,
            IntPtr /*HKEY*/ hKeyProgId);
    }

    [ComImport]
    [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
    [Guid("000214e4-0000-0000-c000-000000000046")]
    internal interface IContextMenu //实现右键扩展
    {
        [PreserveSig]
        int QueryContextMenu(
            IntPtr /*HMENU*/ hMenu,
            uint iMenu,
            uint idCmdFirst,
            uint idCmdLast,
            uint uFlags);

        void InvokeCommand(IntPtr pici);

        void GetCommandString(
            UIntPtr idCmd,
            uint uFlags,
            IntPtr pReserved,
            StringBuilder pszName,
            uint cchMax);
    }

    #endregion 右键菜单的接口

    #region 文件右键管理用API

    public class NativeApi
    {
        #region 各种结构体

        [Flags]
        internal enum CMF : uint
        {
            CMF_NORMAL = 0x00000000,
            CMF_DEFAULTONLY = 0x00000001,
            CMF_VERBSONLY = 0x00000002,
            CMF_EXPLORE = 0x00000004,
            CMF_NOVERBS = 0x00000008,
            CMF_CANRENAME = 0x00000010,
            CMF_NODEFAULT = 0x00000020,
            CMF_INCLUDESTATIC = 0x00000040,
            CMF_ITEMMENU = 0x00000080,
            CMF_EXTENDEDVERBS = 0x00000100,
            CMF_DISABLEDVERBS = 0x00000200,
            CMF_ASYNCVERBSTATE = 0x00000400,
            CMF_OPTIMIZEFORINVOKE = 0x00000800,
            CMF_SYNCCASCADEMENU = 0x00001000,
            CMF_DONOTPICKDEFAULT = 0x00002000,
            CMF_RESERVED = 0xFFFF0000
        }

        [Flags]
        internal enum CMIC : uint
        {
            CMIC_MASK_ICON = 0x00000010,
            CMIC_MASK_HOTKEY = 0x00000020,
            CMIC_MASK_NOASYNC = 0x00000100,
            CMIC_MASK_FLAG_NO_UI = 0x00000400,
            CMIC_MASK_UNICODE = 0x00004000,
            CMIC_MASK_NO_CONSOLE = 0x00008000,
            CMIC_MASK_ASYNCOK = 0x00100000,
            CMIC_MASK_NOZONECHECKS = 0x00800000,
            CMIC_MASK_FLAG_LOG_USAGE = 0x04000000,
            CMIC_MASK_SHIFT_DOWN = 0x10000000,
            CMIC_MASK_PTINVOKE = 0x20000000,
            CMIC_MASK_CONTROL_DOWN = 0x40000000
        }

        [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
        internal struct CMINVOKECOMMANDINFO
        {
            public uint cbSize;
            public CMIC fMask;
            public IntPtr hwnd;
            public IntPtr verb;
            [MarshalAs(UnmanagedType.LPStr)] public string parameters;
            [MarshalAs(UnmanagedType.LPStr)] public string directory;
            public int nShow;
            public uint dwHotKey;
            public IntPtr hIcon;
        }

        [Flags]
        public enum MIIM : uint
        {
            MIIM_STATE = 0x00000001,
            MIIM_ID = 0x00000002,
            MIIM_SUBMENU = 0x00000004,
            MIIM_CHECKMARKS = 0x00000008,
            MIIM_TYPE = 0x00000010,
            MIIM_DATA = 0x00000020,
            MIIM_STRING = 0x00000040,
            MIIM_BITMAP = 0x00000080,
            MIIM_FTYPE = 0x00000100
        }

        public enum MFT : uint
        {
            MFT_STRING = 0x00000000,
            MFT_BITMAP = 0x00000004,
            MFT_MENUBARBREAK = 0x00000020,
            MFT_MENUBREAK = 0x00000040,
            MFT_OWNERDRAW = 0x00000100,
            MFT_RADIOCHECK = 0x00000200,
            MFT_SEPARATOR = 0x00000800,
            MFT_RIGHTORDER = 0x00002000,
            MFT_RIGHTJUSTIFY = 0x00004000
        }

        [Flags]
        public enum MFS : uint
        {
            MFS_ENABLED = 0x00000000,
            MFS_UNCHECKED = 0x00000000,
            MFS_UNHILITE = 0x00000000,
            MFS_GRAYED = 0x00000003,
            MFS_DISABLED = 0x00000003,
            MFS_CHECKED = 0x00000008,
            MFS_HILITE = 0x00000080,
            MFS_DEFAULT = 0x00001000
        }

        public struct MenuItem
        {
            internal IntPtr Bitmap;
            internal string Commands;
            internal bool? ShowInMainMenu;
            internal string Text;
            internal bool Enabled;

            internal MenuItem(string text, bool enabled, bool? showInMainMenu, IntPtr bitmap, string commands)
            {
                ShowInMainMenu = showInMainMenu;
                Text = text;
                Enabled = enabled;
                Bitmap = bitmap;
                Commands = commands;
            }
        }

        [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
        public struct MENUITEMINFO
        {
            public uint cbSize;
            public MIIM fMask;
            public MFT fType;
            public MFS fState;
            public uint wID;
            public IntPtr hSubMenu;
            public IntPtr hbmpChecked;
            public IntPtr hbmpUnchecked;
            public UIntPtr dwItemData;
            public string dwTypeData;
            public uint cch;
            public IntPtr hbmpItem;
        }

        [Flags]
        public enum HChangeNotifyFlags
        {
            SHCNF_DWORD = 0x0003,
            SHCNF_IDLIST = 0x0000,
            SHCNF_PATHA = 0x0001,
            SHCNF_PATHW = 0x0005,
            SHCNF_PRINTERA = 0x0002,
            SHCNF_PRINTERW = 0x0006,
            SHCNF_FLUSH = 0x1000,
            SHCNF_FLUSHNOWAIT = 0x2000
        }

        [Flags]
        public enum HChangeNotifyEventID
        {
            SHCNE_ALLEVENTS = 0x7FFFFFFF,

            SHCNE_ASSOCCHANGED = 0x08000000,

            SHCNE_ATTRIBUTES = 0x00000800,

            SHCNE_CREATE = 0x00000002,

            SHCNE_DELETE = 0x00000004,

            SHCNE_DRIVEADD = 0x00000100,

            SHCNE_DRIVEADDGUI = 0x00010000,

            SHCNE_DRIVEREMOVED = 0x00000080,

            SHCNE_EXTENDED_EVENT = 0x04000000,

            SHCNE_FREESPACE = 0x00040000,

            SHCNE_MEDIAINSERTED = 0x00000020,

            SHCNE_MEDIAREMOVED = 0x00000040,

            SHCNE_MKDIR = 0x00000008,

            SHCNE_NETSHARE = 0x00000200,

            SHCNE_NETUNSHARE = 0x00000400,

            SHCNE_RENAMEFOLDER = 0x00020000,

            SHCNE_RENAMEITEM = 0x00000001,

            SHCNE_RMDIR = 0x00000010,

            SHCNE_SERVERDISCONNECT = 0x00004000,

            SHCNE_UPDATEDIR = 0x00001000,

            SHCNE_UPDATEIMAGE = 0x00008000
        }

        #endregion 各种结构体

        [DllImport("user32", CharSet = CharSet.Unicode, SetLastError = true)]
        [return: MarshalAs(UnmanagedType.Bool)]
        public static extern bool InsertMenuItem(IntPtr hMenu, uint uItem,
            [MarshalAs(UnmanagedType.Bool)] bool fByPosition,
            ref MENUITEMINFO mii);

        [DllImport("user32.dll", CharSet = CharSet.Unicode, SetLastError = true)]
        public static extern IntPtr CreatePopupMenu();

        [DllImport("shell32", CharSet = CharSet.Unicode)]
        public static extern uint DragQueryFile(
            IntPtr hDrop,
            uint iFile,
            StringBuilder pszFile,
            int cch);

        [DllImport("ole32.dll", CharSet = CharSet.Unicode)]
        public static extern void ReleaseStgMedium(ref STGMEDIUM pmedium);

        [DllImport("user32.dll", CharSet = CharSet.Auto, ExactSpelling = true)]
        public static extern IntPtr GetDesktopWindow(IntPtr hWnd);

        [DllImport("user32.dll", CharSet = CharSet.Auto, ExactSpelling = true)]
        public static extern IntPtr UpdateWindow(IntPtr hWnd);

        [DllImport("user32.dll")]
        public static extern IntPtr GetWindowDC(IntPtr hWnd);

        [DllImport("shell32.dll")]
        public static extern void SHChangeNotify(HChangeNotifyEventID wEventId, HChangeNotifyFlags uFlags,
            IntPtr dwItem1, IntPtr dwItem2);

        [DllImport("user32.dll", CharSet = CharSet.Auto, ExactSpelling = true)]
        public static extern IntPtr GetDesktopWindow();

        #endregion 文件右键管理用API
    }
}

实现的效果如下

免费评分

参与人数 1吾爱币 +2 热心值 +1 收起 理由
zhanglei1371 + 2 + 1 谢谢大佬的回复!

查看全部评分

4#
 楼主| zhanglei1371 发表于 2023-6-17 11:46 |楼主
cdj68765 发表于 2023-6-17 11:30
下面是我以前写的一个项目里面用到的代码,用来实现你说的的功能,有一点儿复杂,有问题直接来问我
[mw_sh ...

谢谢大佬的回复,现在就差一点就能编译了,不知这个ICO类能否提供个?

或者从哪里能获取?
5#
 楼主| zhanglei1371 发表于 2023-6-17 11:47 |楼主

不好意思,手误,已修改。
源码+附件都是C#的。
6#
hrpzcf 发表于 2023-6-17 13:07
zhanglei1371 发表于 2023-6-17 11:46
谢谢大佬的回复,现在就差一点就能编译了,不知这个ICO类能否提供个?

或者从哪里能获取?

这应该是图标资源,改成 null 看看
7#
cdj68765 发表于 2023-6-17 13:49
本帖最后由 cdj68765 于 2023-6-17 14:57 编辑
zhanglei1371 发表于 2023-6-17 11:46
谢谢大佬的回复,现在就差一点就能编译了,不知这个ICO类能否提供个?

或者从哪里能获取?

嗯,跟楼上说的一样,这些都是图片路径,可以直接换成Null,或者换成你想要的图标路径,这个应该不难

对了,忘记把最重要的注册方式给你了
[C#] 纯文本查看 复制代码
 bool RegOrUnReg = true;
            try
            {
                var clsid = "{B3F0615C-D04E-41DC-A1EB-4E8B8DCC14A1}";//随机生成,不需要跟这个一样,但是要和FileContextMenuExt的[Guid("B3F0615C-D04E-41DC-A1EB-4E8B8DCC14A1")]保持一致,只是为了在注册表内有一个唯一性标识
                var rs = new RegistrationServices();
                if (RegOrUnReg)
                {
                    rs.RegisterAssembly(Assembly.GetAssembly(typeof(FileContextMenuExt)),AssemblyRegistrationFlags.SetCodeBase);//注册右键菜单实例
                    using (var key =Registry.ClassesRoot.CreateSubKey($@"*\shellex\ContextMenuHandlers\{clsid}"))//注册表内注册到HKEY_CLASSES_ROOT\*下面,*代表给所有文件都注册该菜单,如果只想给特定后缀的文件,可以把*换成.exe或者别的啥,具体自己实验下
                    {
                        key?.SetValue(null, clsid);
                    }

                    using (var key = Registry.ClassesRoot.CreateSubKey(@"Directory\Background\shell\解密粘贴\Command"))//该条是给桌面或者文件夹空白处注册右键菜单用,如果不需要这个可以不加,而且实现方式也和上述的不同,是直接在注册表内创建右键菜单项目,然后调用exe 赋予参数 实现相应功能
                    {
                        key?.SetValue(null, $"\"{Application.ExecutablePath}\" Copy \"%V\"");
                    }

                }
                else
                {
                //删除注册就是删除对应的注册表项目
                    Registry.ClassesRoot?.DeleteSubKeyTree($@"*\shellex\ContextMenuHandlers\{clsid}");
                    Registry.ClassesRoot?.DeleteSubKeyTree(@"Directory\Background\shell\解密粘贴", false);
                    rs.UnregisterAssembly(Assembly.GetAssembly(typeof(FileContextMenuExt)));
                }
            }
            catch (Exception e)
            {
            }

以上所有代码我都发布到https://github.com/cdj68765/CaxaHook/tree/Release里面去了,有需要可以自己去取(PS:这个项目挺庞杂的,还有很多意想不到的技术)

免费评分

参与人数 1吾爱币 +2 热心值 +1 收起 理由
zhanglei1371 + 2 + 1 谢谢@Thanks!

查看全部评分

8#
 楼主| zhanglei1371 发表于 2023-6-18 06:39 |楼主
cdj68765 发表于 2023-6-17 13:49
嗯,跟楼上说的一样,这些都是图片路径,可以直接换成Null,或者换成你想要的图标路径,这个应该不难

...

非常感谢大佬的指点,还有个就是关于如何调试的问题想再请教下:
现在的做法就是先生成dll,然后再注册dll,再到资管里右键文件==>查看效果;
但是由于可能涉及到很多需要修改的地方,每次修改都得重新生成dll==>注册dll,
甚至还需要结束explorer进程,再重新开启,才能看到更新的效果。
这样调试的效率实在太低了。
有没有办法能做到断点调试呢?
打上断点后能观察到变量的变化,这样方便灵活的去修改?
9#
cdj68765 发表于 2023-6-18 08:47
zhanglei1371 发表于 2023-6-18 06:39
非常感谢大佬的指点,还有个就是关于如何调试的问题想再请教下:
现在的做法就是先生成dll,然后再注册d ...

不需要专门生成dll再注册,我是直接在exe里面执行
var rs = new RegistrationServices();
rs.RegisterAssembly(...);
执行注册的以及反注册的,这些看我上面的代码就行
确实有更好的办法,就是给你想要调试的代码前面加Debugger.Launch();来启动VS调试器,载入你的项目
要不你私信留给我你的QQ吧,这样有些东西沟通起来比较方便

免费评分

参与人数 1热心值 +1 收起 理由
zhanglei1371 + 1 谢谢!

查看全部评分

您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则

返回列表

RSS订阅|小黑屋|处罚记录|联系我们|吾爱破解 - LCG - LSG ( 京ICP备16042023号 | 京公网安备 11010502030087号 )

GMT+8, 2024-11-24 22:20

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表