在C#中挂钩另一个应用程序 [英] Hooking Into Another Application In C#

查看:59
本文介绍了在C#中挂钩另一个应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为我的应用程序创建一个插件API,为了做到这一点,我需要能够挂钩到应用程序本身并且能够抓取,并且可能设置信息,什么是最好的方法要做到这一点,我想,如果可能的话,只能使用原生C#而不必使用任何外部DLL。



-Jordan

I am attempting to make a plugin API for my application, in order to do this, i need to be able to hook into the application itself and be able to grab, and maybe set information, what would be the best way to go about doing this, I would like, if possible, to be able to do this using only native C# and not have to use any external DLLs.

-Jordan

推荐答案

刚刚搜索了一下,发现了这个:

一个灵活的插件系统 [ ^ ]



编辑:

你可以简单地用它来获取一个值主exe:

Just searched a little and found this:
A Flexible Plugin System[^]


you can simple use this to get a value from the main exe:
int x = (int)System.Reflection.Assembly.GetEntryAssembly().GetType("SharedVarsClass").GetField("SharedVar").GetValue(null);


首先,你可以使用Mi. crosoft MEF框架:

http://en.wikipedia.org/wiki/Managed_Extensibility_Framework [ ^ ],

http://mef.codeplex.com/ [ ^ ],

http://msdn.microsoft.com/en-us/library/dd460648%28VS.100%29.aspx [ ^ ]。



你可以自己做,特别是如果你需要它就像你真正需要的那样简单。请看我过去的回答,只有一个,但它有我过去的其他答案的链接,另外7个。他们详细介绍了这个主题:一般来说插件的用途是什么 [ ^ ]。



-SA
First, you can use the Microsoft MEF framework:
http://en.wikipedia.org/wiki/Managed_Extensibility_Framework[^],
http://mef.codeplex.com/[^],
http://msdn.microsoft.com/en-us/library/dd460648%28VS.100%29.aspx[^].

You can do it yourself, especially if you need it as simple as you really need. Please see my past answer, only one, but it has links to my other past answers, another 7. They cover the topic in detail: What is the use of plugin in general[^].

—SA


这篇关于在C#中挂钩另一个应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆