日期:2014-05-17 浏览次数:20581 次
读卡器dll的接口函数:
int open_comm(int comm_id);
int CardReady(long *snr);
调用的方法是:
[DllImport( "...WM_Mifare.dll ", CharSet = CharSet.Ansi)]\\dll是绝对路径
public static extern int open_comm(string comm_id);
public int InitReaderDll(string comm_id)
{
return open_comm(comm_id);
}
[DllImport( "E:\\.....WM_Mifare.dll ", CharSet = CharSet.Ansi)]\\dll是绝对路径
public static extern int CardReady(string snr);
public int DllReader(string snr)
{
return CardReady(snr);
}
调用指令:
private void button2_Click(object sender, EventArgs e)
{
this.skclass.InitReaderDll(a);
this.skclass.DllReader(i);
this.textBox3.Text = i;
}
int open_comm(int comm_id);
int CardReady(long *snr);
对应:
public static extern int open_comm(int comm_id);
public static extern int CardReady(ref long snr);
------解决方案--------------------
activeX
------解决方案--------------------
activeX