110,535
社区成员
发帖
与我相关
我的任务
分享
[DllImport("SSCardDriver.dll")]
public static extern long iReadCardBas(int iType, string pOutInfo);
private void button1_Click(object sender, EventArgs e)
{
char[] y=new char[1024];
long x = iReadCardBas(1,y);
if(x==0)
{
MessageBox.Show(new string(y));
}
MessageBox.Show("Error Msg:"+new string(y));
}
这样应该没问题……注意long无法隐式转换为int,你这里的x应该是接收不到返回值或者会报错才对。y同样不是string,是需要先用char[]接收,然后转换成string。