要在vs.net中使用unsafe code 我们必须在项目的属性中设置一下,设置方法如下: 点项目属性(Properties)->生成(Build)->常规(General)中:钩上允许不安全代码(Allow unsafe code)