DllImport Attempted to read or write protected memory
int ReadCard(char *room, char *gate,char *stime, char *guestname, char *guestid, char *track1, char *track2, long *cardno, int *st);
这是dll里的原函数
其中:room、gate、stime、guestname、guestid、track1、track2、cardno、st为输出参数
gate、Guestname 、Guestid 、track1 、track2 可以为null
翻译成C#的代码:
int ReadCard(ref string room, string gate, ref string stime,
ref string guestname, ref string guestid, string track1, string track2,
ref int cardno, ref int st);
这样写报错哟,你帮我看看!!
Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
试图读取或写入受保护的内存。这往往是一个迹象表明其他内存已损坏。