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