C# SLE5528,ACR38U-4A智能卡读卡器?
C# 我试着打电话给智能卡并选择它的类型,但我所有的选项都返回了一个名为E600的错误 我试着从课堂和说明中选择卡片类型,但没有帮助,有什么解释吗? 解决办法是什么 无论如何谢谢你C# SLE5528,ACR38U-4A智能卡读卡器?,c#,smartcard,reader,writer,acr,C#,Smartcard,Reader,Writer,Acr,C# 我试着打电话给智能卡并选择它的类型,但我所有的选项都返回了一个名为E600的错误 我试着从课堂和说明中选择卡片类型,但没有帮助,有什么解释吗? 解决办法是什么 无论如何谢谢你 private void bConnect_Click_1(object sender, EventArgs e) { int indx; string tmpStr; if (this.ConnActive == true) {
private void bConnect_Click_1(object sender, EventArgs e)
{
int indx;
string tmpStr;
if (this.ConnActive == true)
{
DisplayOut(0, 0, "Connection is already active", "MCU");
return;
}
//' 1. Connect to reader using SCARD_SHARE_DIRECT
retcode = ModWinsCard64.SCardConnect(G_hContext, cbReader.Text, ModWinsCard64.SCARD_SHARE_SHARED, ModWinsCard64.SCARD_PROTOCOL_T1 | ModWinsCard64.SCARD_PROTOCOL_T0, ref hCard, ref ActiveProtocol);
if (retcode != ModWinsCard64.SCARD_S_SUCCESS)
{
lstOutput.Items.Add("Connection Error");
DisplayOut(1, retcode, "", "MCU");
ConnActive = false;
return;
}
else
{
DisplayOut(0, 0, "Successful connection to " + cbReader.Text, "MCU");
}
lstOutput.SelectedIndex = lstOutput.Items.Count - 1;
ClearBuffers();
ClearBuffers();
//Select CardType
SendBuff[0] = 0xFF;
SendBuff[1] = 0xA4;
SendBuff[2] = 0x00;
SendBuff[3] = 0x00;
SendBuff[4] = 0x01;
SendBuff[5] = 0x05;
SendBuffLen = 6;
RecvBuffLen = 255;
tmpStr = "";
for (indx = 0; indx <= SendBuffLen - 1; indx++)
{
tmpStr = tmpStr + string.Format("{0:x2}", (SendBuff[indx])).ToUpper() + " ";
}
retcode = this.SendAPDUandDisplay(2, tmpStr);
if (retcode != ModWinsCard64.SCARD_S_SUCCESS)
{
return;
}
ConnActive = true;
fFunction.Enabled = true;
ClearFields();
tHiAdd.Focus();
bConnect.Enabled = false;
}
private void b连接\u单击\u 1(对象发送方,事件参数e)
{
int indx;
字符串tmpStr;
如果(this.ConnActive==true)
{
显示输出(0,0,“连接已激活”,“MCU”);
返回;
}
//“1.使用SCARD\u SHARE\u DIRECT连接到读卡器
retcode=ModWinsCard64.SCardConnect(G_hContext,cbReader.Text,ModWinsCard64.SCARD_SHARE_SHARED,ModWinsCard64.SCARD_PROTOCOL_T1 | ModWinsCard64.SCARD_PROTOCOL_T0,ref hCard,ref ActiveProtocol);
if(retcode!=ModWinsCard64.SCARD\u S\u成功)
{
lstOutput.Items.Add(“连接错误”);
显示(1,retcode,“,“MCU”);
ConnActive=false;
返回;
}
其他的
{
显示(0,0,“成功连接到”+cbReader.Text,“MCU”);
}
lstOutput.SelectedIndex=lstOutput.Items.Count-1;
ClearBuffers();
ClearBuffers();
//选择卡片类型
SendBuff[0]=0xFF;
SendBuff[1]=0xA4;
SendBuff[2]=0x00;
SendBuff[3]=0x00;
SendBuff[4]=0x01;
SendBuff[5]=0x05;
SendBuffLen=6;
RecvBuffLen=255;
tmpStr=“”;
对于(indx=0;indx)您无法解锁智能卡有很多原因。电脑上的驱动程序可能不正确,您使用了错误的大小寻址/数据(8、16、32位)。我通常建议在windows中解锁卡。一旦解锁卡,它将一直保持解锁状态,直到电脑关闭。解锁卡后,请尝试读取卡以确定您是否使用了正确的地址和数据大小。然后尝试写入卡。最后让代码在c中解锁卡。您似乎正在格式化APDU作为可打印的十六进制字符,您应该在其中使用普通字节。我解决了这个问题,但我发现我尝试写入和读取的其他站点没有响应者名称(检测到与智能卡的通信错误。重试该操作)无法解锁智能卡的原因有很多。电脑上的驱动程序可能不正确,您使用了错误的地址/数据大小(8、16、32位)。我通常建议在windows中解锁卡。一旦解锁卡,它将一直保持解锁状态,直到电脑关闭。解锁卡后,请尝试读取卡以确定您是否使用了正确的地址和数据大小。然后尝试写入卡。最后让代码在c中解锁卡。您似乎正在格式化APDU作为可打印的十六进制字符,您应该在其中使用普通字节。我解决了这个问题,但我发现我尝试写入和读取的其他站点没有响应者名称(检测到与智能卡的通信错误。重试该操作)