Share via


[Sample Of Nov 30th] How to check the executable file type in .NET

 

Homepage image
RSS Feed

Sample Download : https://code.msdn.microsoft.com/CSCheckExeType-aab06100

The sample demonstrates how to check an executable file type. Given an exe or a dll,
the sample application detects:

 1. exe type (console or GUI, or other exe type) by checking the subsystem flag in PE
 2. Is it a .NET assembly?
    If no,
        - detect the exe bitness (x86 or x64)
    If yes,
        - detect the exe bitness (ANY CPU, x86, x64)
        - detect compiled .NET runtime version
        - print the full name of the assembly
         (e.g. System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL)

 

imageYou can find more code samples that demonstrate the most typical programming scenarios by using Microsoft All-In-One Code Framework Sample Browser or Sample Browser Visual Studio extension. They give you the flexibility to search samples, download samples on demand, manage the downloaded samples in a centralized place, and automatically be notified about sample updates. If it is the first time that you hear about Microsoft All-In-One Code Framework, please watch the introduction video on Microsoft Showcase, or read the introduction on our homepage https://1code.codeplex.com/.