Пример #1
0
        private bool CheckInfo()
        {
            if (tBSheQuName.Text.Trim() == "" || tBLouYuanName.Text.Trim() == "")
            {
                MessageBox.Show("请检查社区名称和楼院名称!");
                return(false);
            }

            if (tBName.Text.Trim() == "" || !IDCheck.CheckIDCard(tBShenFenID.Text.Trim()))
            {
                MessageBox.Show("请检查名字或者身份证号码非法!");
                return(false);
            }


            return(true);
        }
Пример #2
0
        private void btnPic_Click(object sender, EventArgs e)
        {
            Bitmap img = vispShoot.GetCurrentVideoFrame();//拍照

            //这里可以根据情况,把照片存到某个路径下
            //img.Save("");
            if (tBName.Text.Trim() == "" || !IDCheck.CheckIDCard(tBShenFenID.Text.Trim()))
            {
                MessageBox.Show("未录入姓名或者身份证格式不正常!请核对后重新拍照!");
                return;
            }
            else
            {
                img.Save(getDataPath() + Path.DirectorySeparatorChar.ToString() + "image" + Path.DirectorySeparatorChar.ToString() + tBShenFenID.Text.Trim() + ".jpg", System.Drawing.Imaging.ImageFormat.Jpeg);
                img.Save(getDataPath() + Path.DirectorySeparatorChar.ToString() + "image" + Path.DirectorySeparatorChar.ToString() + tBName.Text.Trim() + tBShenFenID.Text.Trim() + ".jpg", System.Drawing.Imaging.ImageFormat.Jpeg);
            }
            picbPreview.Image = img;
        }
Пример #3
0
        private void bReadID_Click(object sender, EventArgs e)
        {
            //MessageBox.Show("身份证厂家特别垃圾,还没有提供阅读器SDK,该功能稍等!");
            Base.IDInfo idInfo = new Base.IDInfo();

            string resultMsg = Base.getRspMsg(Base.readCard(ref idInfo, 15));

            if (resultMsg.IndexOf("读取成功") == -1)
            {
                MessageBox.Show(resultMsg);
            }

            //if (Base.getRspMsg(Base.readCard(ref idInfo,15)).IndexOf("读取成功") != -1)

            //MessageBox.Show(Base.getRspMsg(Base.readCard(ref idInfo, 15)));
            //readCard(ref idInfo, 15);
            tBName.Text      = idInfo.name;
            cBSex.Text       = idInfo.sex;
            tBNation.Text    = IDCheck.getNational(idInfo.ethnicity);
            tBShenFenID.Text = idInfo.cardNo;
            tBIDAddress.Text = idInfo.address;
        }