有沒有一種方法可以告訴我一直在使用什麼框架,因爲我需要訪問machine.config?框架或框架64?
C:\ Windows \ Microsoft.NET \目錄下的Framework或Framework 64都有該文件。
有沒有一種方法可以告訴我一直在使用什麼框架,因爲我需要訪問machine.config?框架或框架64?
C:\ Windows \ Microsoft.NET \目錄下的Framework或Framework 64都有該文件。
看看這篇文章:如果您使用的是.NET 4,它在Environment類中有兩個屬性,Is64BitOperatingSystem和Is64BitProcess。給他們一個嘗試。
和對這篇文章一看,這是非常有用的: How to detect programmatically whether you are running on 64-bit Windows
從代碼內部?在C#4.0中Environment.Is64BitProcess
,在< 4.0 IntPtr.Size
。並閱讀How to detect Windows 64-bit platform with .NET?
注意大寫字母!它特別是Environment.Is64BitProcess – Rich 2014-02-05 11:01:12