C#中调用DLL的指针传值方法
作者:team 日期:2011-04-07
在通用DLL中经常会用到指针传值,那么C#中如何调用DLL的指针?请看以下代码:
1,申明:
[DllImport("ICDll.dll")]
public static extern int SS_SelectCard(int Remode, Byte[] Resnr);
通过 Byte 替换 指针.
2,调用:
Byte[] Resnr = new Byte[4];
int ts = test.SS_SelectCard(0, Resnr);
3,将Byte中的内容转换成字符串
string temp = " ";
foreach (byte b in byteArray)
temp += string.Format("{0:X2}", b);
以上三步经过测试
评论: 0 | 引用: 0 | 查看次数: -
发表评论


上一篇:
下一篇:
文章来自:
Tags:
相关日志: