C#中如何使用指针

1. 项目右键--属性---生成--允许不安全代码

2.在代码中加入unsafe关键字

[DllImport("DLL.dll")]
unsafe public static extern bool UsbWrite(char* WriteBuffer, int size);

[DllImport("DLL.dll")]
unsafe public static extern bool UsbRead(char* ReadBuffer, int size);

 

posted @ 2015-01-03 15:24  qq921201008  阅读(216)  评论(0编辑  收藏  举报