C#获取启动另一个exe的exe程序集 [英] C# get assembly of exe that started another exe

查看:201
本文介绍了C#获取启动另一个exe的exe程序集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个自定义DLL,供以后的许多未来项目使用;

它的功能之一是下载具有
的软件的更新 DLL已加载.

DLL部分起作用;它会检查我的服务器上是否有版本文件,如果找到更新,它将要求下载并安装更新.

问题来了:一旦更新程序exe
(从这里开始称为"patcher",但其工作方式更像是自解压的exe).
下载后,我需要从DLL中启动修补程序,并且需要修补程序来获取DLL正在运行修补程序的exe的程序集,以便修补程序可以尝试强制应用程序的所有实例终止(并且等待这样做),然后解压缩自身并覆盖所有文件.

我已经搜索过google,但可能未使用正确的关键字.

预先感谢,
--Xyphos

I''m writting a custom DLL for use later with many of my future projects;

one of it''s features is to download updates of the software that has the
DLL loaded.

the DLL part works; it checks my server for a version file and if an update is found, it''ll ask to download and install the update.

here''s the problem: once the updater exe
(from here on called a `patcher` but works more like a self-extracting exe)
is downloaded, I need to start the patcher from within the DLL, and I need the patcher to get the assembly of the exe that the DLL is running the patcher from so the patcher can attempt to force all instances of the application to terminate (and wait to do so) before extracting itself and overwriting any files.

I''ve searched google but I''m probably not using the correct keywords.

thanks in advance,
--Xyphos

推荐答案

昨天有类似问题;-)

Assembly.GetEntryAssembly()

http://www.codeproject.com/Answers/97545/Using- fields-from-different-assembly.aspx#answer1 [ ^ ]

祝你好运!
Same kind of question yesterday ;-)

Assembly.GetEntryAssembly()

http://www.codeproject.com/Answers/97545/Using-fields-from-different-assembly.aspx#answer1[^]

Good luck!


这篇关于C#获取启动另一个exe的exe程序集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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