Possible Duplicate:
How do I tell if a win32 application uses the .NET runtime
There is a way to manually recognize if a specific ".exe" process was written with C++(unmanaged code) or with C#(managed code)?
If you're trying to determine if a process is a .NET process, I can suggest a solution inspired from Dave Van den Eynde's answer in this topic: How do I tell if a win32 application uses the .NET runtime
"An application is a .NET executable if it requires mscoree.dll to run.".
Given that, you check the process' modules to see if mscoree is listed.
foreach (var process in Process.GetProcesses())
{
if (process.Modules.OfType<ProcessModule>().Any(m => m.ModuleName.Equals("mscoree.dll", StringComparison.OrdinalIgnoreCase)))
{
Console.WriteLine("{0} is a .NET process", process.ProcessName);
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With