private void ScanCard() { int lRet = 0; int w1, h1, w2, h2; w1 = h1 = w2 = h2 = 0; if (true) { pid_Card = new A8ScannerReaderImporter.Id_Card(); lRet = A8ScannerReaderImporter.IO_ReadRFIDInfo(ref pid_Card); if (lRet == 0) { this.txtInfo.Text += ByteToString(pid_Card.id_Name) + "\r\n"; this.txtInfo.Text += ByteToString(pid_Card.id_Sex) + "\r\n"; this.txtInfo.Text += ByteToString(pid_Card.id_Born) + "\r\n"; this.txtInfo.Text += ByteToString(pid_Card.id_Code) + "\r\n"; this.txtInfo.Text += ByteToString(pid_Card.id_NewAddr) + "\r\n"; this.txtInfo.Text += ByteToString(pid_Card.id_Home) + "\r\n"; this.txtInfo.Text += ByteToString(pid_Card.id_ValidPeriod) + "\r\n"; this.txtInfo.Text += ByteToString(pid_Card.id_RegOrg) + "\r\n"; this.txtInfo.Text += ByteToString(pid_Card.id_Home) + "\r\n"; this.txtInfo.Text += ByteToString(pid_Card.id_ValidPeriod) + "\r\n"; int g_DPI = (optDPI300.Checked ? 300 : 600); lRet = A8ScannerReaderImporter.IO_GetImgFromUnit(g_DPI, "Picture1.bmp", ref w1, ref h1, "Picture2.bmp", ref w2, ref h2); if (lRet == 0) { if (chkToJpg.Checked) { lRet = A8ScannerReaderImporter.BmpToJpeg(@"Picture1.bmp", @"Picture1.jpg"); if (lRet == 0) { File.Delete("Picture1.bmp"); } lRet = A8ScannerReaderImporter.BmpToJpeg(@"Picture2.bmp", @"Picture2.jpg"); if (lRet == 0) { File.Delete(@"Picture2.bmp"); } } MessageBox.Show("Get Image From Unit Success."); } else { MessageBox.Show("Get Image From Unit Failed."); } } } else { MessageBox.Show("请插入二代身份证"); } }
private void ScanCard() { int lRet = 0; int w1, h1, w2, h2; w1 = h1 = w2 = h2 = 0; if (true) { pid_Card = new A8ScannerReaderImporter.Id_Card(); lRet = A8ScannerReaderImporter.IO_ReadRFIDInfo(ref pid_Card); if (lRet == 0) { this.txtInfo.Text += ByteToString(pid_Card.id_Name) + "\r\n"; this.txtInfo.Text += ByteToString(pid_Card.id_Sex) + "\r\n"; this.txtInfo.Text += ByteToString(pid_Card.id_Born) + "\r\n"; this.txtInfo.Text += ByteToString(pid_Card.id_Code) + "\r\n"; this.txtInfo.Text += ByteToString(pid_Card.id_NewAddr) + "\r\n"; this.txtInfo.Text += ByteToString(pid_Card.id_Home) + "\r\n"; this.txtInfo.Text += ByteToString(pid_Card.id_ValidPeriod) + "\r\n"; this.txtInfo.Text += ByteToString(pid_Card.id_RegOrg) + "\r\n"; this.txtInfo.Text += ByteToString(pid_Card.id_Home) + "\r\n"; this.txtInfo.Text += ByteToString(pid_Card.id_ValidPeriod) + "\r\n"; int g_DPI = (optDPI300.Checked ? 300 : 600); lRet = A8ScannerReaderImporter.IO_GetImgFromUnit(g_DPI, "Picture1.bmp", ref w1, ref h1, "Picture2.bmp", ref w2, ref h2); if (lRet == 0) { if (chkToJpg.Checked) { lRet = A8ScannerReaderImporter.BmpToJpeg(@"Picture1.bmp", @"Picture1.jpg"); if (lRet == 0) File.Delete("Picture1.bmp"); lRet = A8ScannerReaderImporter.BmpToJpeg(@"Picture2.bmp", @"Picture2.jpg"); if (lRet == 0) File.Delete(@"Picture2.bmp"); } MessageBox.Show("Get Image From Unit Success."); } else MessageBox.Show("Get Image From Unit Failed."); } } else { MessageBox.Show("请插入二代身份证"); } }