1

在此处输入图像描述 C# 我尝试调用智能卡并选择它的类型,但我的所有选项都返回了一个名为 E600 的错误我试图从类和说明中选择卡类型,但没有帮助,有什么解释吗?有什么解决办法还是谢谢

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;
    }

新错误!

4

0 回答 0