获取当前可执行文件的名字从组装VS过程? [英] Getting name of the current executable from assembly vs process?

查看:96
本文介绍了获取当前可执行文件的名字从组装VS过程?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是一个在跟进这个答案(和它的评论)。从装配得到一个可执行文件名称VS流程之间的区别是什么?

This is a follow up on this answer (and it's comments). What is the difference between getting an executable name from assembly vs process?

System.Reflection.Assembly.GetCallingAssembly.GetEntryAssembly().CodeBase 

VS

Process.GetCurrentProcess().ProcessName

我假定这将是相同的所有的时间?没有?是否有利弊?

I'm assuming these will be the same all the time? No? Are there pros and cons?

推荐答案

ProcessName是操作系统主机进程名称。

ProcessName is the name of the Operating System host process.

大会codeBase的点给定的进程内的组件。同样的组件可通过不同的工艺进行托管。

Assembly CodeBase points to an assembly inside a given process. The same assembly can be hosted by different processes.

这篇关于获取当前可执行文件的名字从组装VS过程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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