How can I determine the subsystem used by a given .NET assembly?

前端 未结 4 512
野趣味
野趣味 2020-12-06 19:22

In a C# application, I\'d like to determine whether another .NET application is a Console application or not.

Can this be done using the reflection APIs?

EDI

4条回答
  •  渐次进展
    2020-12-06 20:08

    This is out of the scope of managed code. From the .NET perspective, Console and Windows UI applications are the same. You have to peek into the PE file header. Search for the word, "Subsystem" on this page http://msdn.microsoft.com/en-us/magazine/bb985997.aspx

提交回复
热议问题