如何解决如何从智能卡读取或检索数据人员信息...
我使用 ELYCTIS CL Reader 从智能卡读取数据(我尝试了生物识别卡和护照)但我只能检索到 ATR 代码和序列号 是否有任何解释可以从卡中检索数据, 这张图片解释了我试图做的事情;我使用一个包含 APDU 的文件并执行它,上面的代码用于执行按钮 enter image description here enter image description here
private void buttonExecute_Click(object sender,EventArgs e)
{
try
{
if (!m_iCard.Connected)
{
MessageBox.Show("You first need to create a connection with the card.","No connection available");
}
else
{
APDUScript script = (APDUScript)comboBoxScript.SelectedItem;
if (script == null)
{
}
byte[] baCmdBuffer;
byte[] baRespBuffer;
long count = 0;
foreach (APDUInstruction ai in script.listAPDU)
{
baCmdBuffer = APDUScript.toBytes(ai.Command);
count += baCmdBuffer.Length;
baRespBuffer = m_iCard.Transmit(baCmdBuffer,(uint)baCmdBuffer.Length);
count += baRespBuffer.Length;
// Add trace if required
if (checkBoxTrace.Checked)
{
StringBuilder sb = new StringBuilder(ai.Comment);
sb.Append("\r\n");
sb.Append("Send=>");
sb.Append(ai.Command);
sb.Append("\r\n");
sb.Append("Get<=");
String resp = APDUScript.toHexaString(baRespBuffer);
sb.Append(resp);
sb.Append("\r\n");
// Check the response with the expected one
Regex respRegex = new Regex("^" + ai.Resp.Replace('x','.') + "$");
if (!respRegex.IsMatch(resp))
{
sb.Append("The response doesn't match the expected one ");
sb.Append(ai.Resp);
sb.Append("\r\n");
}
if (checkBoxTime.Checked)
sb.Append(String.Format("time {0:0,0 ms}.",StopTimer()));
sb.Append("\r\n");
addLogMsg(sb.ToString());
}
}
double time = StopTimer();
addLogMsg(String.Format("{0:0,0} APDU bytes transferred in {1:0,0 ms}.\r\n",count,time));
}
}
catch (Exception exc)
{
addLogMsg(exc.Message + "\r\n");
}
}
private void buttonClear_Click(object sender,EventArgs e)
{
textBoxLog.Text = "";
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。