https://stackoverflow.com/questions/25953887/how-to-use-unsafe-code-in-safe-contex
I am not sure if you need unsafe code in that case (see answer of @mybirthname).
But when unsafe code is needed, it can be enabled in Project properties.
Project
and then <ProjectName> properties...
Build
page.Allow unsafe code
.Or one can specify /unsafe compiler option explicitly.
无法使用unsafe,需要在项目属性里打开。
测试了一下IntPtr的大小是4字节
https://www.cnblogs.com/darrenji/p/3976029.html
public void TestChuck() { unsafe { Console.WriteLine(sizeof(IntPtr)); } }
Cannot use unsafe construct in safe context
原文:https://www.cnblogs.com/chucklu/p/11183633.html