How to determine programmatically whether a partic

2019-01-01 10:36发布

How can my C# application check whether a particular application/process (note: not the current process) is running in 32-bit or 64-bit mode?

For example, I might want to query a particular process by name, i.e, 'abc.exe', or based on the process ID number.

7条回答
何处买醉
2楼-- · 2019-01-01 11:38

I like to use this:

string e = Environment.Is64BitOperatingSystem

This way if I need to locate or verify a file I can easily write:

string e = Environment.Is64BitOperatingSystem

       // If 64 bit locate the 32 bit folder
       ? @"C:\Program Files (x86)\"

       // Else 32 bit
       : @"C:\Program Files\";
查看更多
登录 后发表回答