[英]Does "Environment.Is64BitProcess" equal to "IntPtr.Size == 8"?
Since "IntPtr.Size" checks the size of int's pointer based on the current process, is it the same as "Environment.Is64BitProcess"?由于“IntPtr.Size”是根据当前进程检查int指针的大小,是不是和“Environment.Is64BitProcess”一样?
If yes, why can I only see "return true/false" (if you use dnSpy to refactor the code from "System")?如果是,为什么我只能看到“返回真/假”(如果您使用 dnSpy 从“系统”重构代码)?
If not, any differences between them?如果不是,它们之间有什么区别吗? Where to use what?
在哪里使用什么?
In modern runtimes (net core) Is64BitProcess
is defined through IntPtr.Size == 8
.在现代运行时(网络核心)
Is64BitProcess
是通过IntPtr.Size == 8
定义的。 See source见源
You see false
because you're inspecting 32-bit mscorlib.您看到
false
是因为您正在检查 32 位 mscorlib。 64-bit is located in C:\Windows\Microsoft.NET\Framework64\v4.0.30319
and always returns true
64 位位于
C:\Windows\Microsoft.NET\Framework64\v4.0.30319
并始终返回true
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.