using DLAFMS.SysCommon.MsgBox;//显示对话框
using DLAFMS.SysCommon;//错误日志处理
using DLAFMS.SysCommon.Config;//读取配置文件
这三个命名空间是我的业务处理类
调用:
private IdentityCardProviderImp icp = new IdentityCardProviderImp();
private void btn_Read_Click(object sender, EventArgs e) {
icp.ReadIdCardCompleteEvent -= new ReadIdCardCompleteDelegate(icp_ReadIdCardCompleteEvent);
icp.ReadIdCardCompleteEvent += new ReadIdCardCompleteDelegate(icp_ReadIdCardCompleteEvent);
icp.ReadIdCard();
}
private void icp_ReadIdCardCompleteEvent(object sender, IdentityCardInfo cardInfo) {
//该事件取得身份证各项信息
txt_UserName.Text = cardInfo.Name;
txt_IdentityNo.Text = cardInfo.CardId;
txt_Sex.Text = MapEnumData.GetDisplayValue(cardInfo.Sex, EnumName.SexType);
txt_Birthday.Text = cardInfo.Birthday;
txt_HomeAddress.Text = cardInfo.Address;
}