Sign in to follow this  
stevenmarky

[.net] Determine file type

Recommended Posts

I am looking for way to determine if a certain file is a .NET IL file as opposed to a normal .dll or .exe. I'm not picky on the language used to achieve this (if there is no way to do it from the command-line). Any help appreciated.

Share this post


Link to post
Share on other sites
You might try:

try{
Assembly.LoadFile(yourFile);
//managed
}catch(BadImageFormatException){
//not managed
}



hope this helps

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this