Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/asp.net-core/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
.net 使用反射确定程序集模块类型_.net_Reflection_.net Assembly - Fatal编程技术网

.net 使用反射确定程序集模块类型

.net 使用反射确定程序集模块类型,.net,reflection,.net-assembly,.net,Reflection,.net Assembly,如何使用.net反射来确定正在执行的程序集的类型,我指的是dll或exe类型。目前可以执行以下操作: Assembly.getExecutionGassembly().CodeBase.ToLower.EndsWith(“.exe”) 但是似乎可以存在更好的东西,不需要进行字符串比较,即比较程序集模块名称也属于这一类。对此不是100%确定,但我认为Assembly.EntryPoint对于DLL是空的。对此不是100%确定,但我认为,Assembly.EntryPoint对于DLL是空的

如何使用.net反射来确定正在执行的程序集的类型,我指的是dll或exe类型。目前可以执行以下操作:

Assembly.getExecutionGassembly().CodeBase.ToLower.EndsWith(“.exe”)


但是似乎可以存在更好的东西,不需要进行字符串比较,即比较程序集模块名称也属于这一类。

对此不是100%确定,但我认为
Assembly.EntryPoint
对于DLL是空的。

对此不是100%确定,但我认为,
Assembly.EntryPoint
对于DLL是空的