您好,欢迎光临本网站![请登录][注册会员]  
文件名称: IC操作 读写器
  所属分类: C++
  开发工具:
  文件大小: 3mb
  下载次数: 0
  上传时间: 2012-01-15
  提 供 者: wjh627******
 详细说明: UINT mainThread(LPVOID ThreadParam) { int ret; uchar szbuff[100]; for(int i=0;i<10;i++) { //memset(szbuff,0,100); ::SendMessage((HWND)ThreadParam,WM_MY_MESSAGE_GET,0,0);//取数据 for(int k=0;k<2;k++) { ret=mifs_request_2(0x26,szbuff); //寻卡 if(ret==0)break; } if(ret!=0){::SendMessage((HWND)ThreadParam,WM_MY_MESSAGE_INFO,14,0);continue;} ret=mifs_load_keyE2(0x60,g_SectorNO,g_KeyA);//装载密钥A if(ret!=0){::SendMessage((HWND)ThreadParam,WM_MY_MESSAGE_INFO,1,0) ;continue;} ret=mifs_anticoll(0x00, g_CardSerialNo);//防冲突,返回卡序号 if(ret!=0){::SendMessage((HWND)ThreadParam,WM_MY_MESSAGE_INFO,3,0);continue;} ret=mifs_select(g_CardSerialNo, szbuff);//根据卡序号选择卡片 if(ret!=0){::SendMessage((HWND)ThreadParam,WM_MY_MESSAGE_INFO,4,0);continue;} ret=mifs_authenticationE2(0x60,g_CardSerialNo, g_SectorNO);//密钥A验证 if(ret!=0){::SendMessage((HWND)ThreadParam,WM_MY_MESSAGE_INFO,5,0);continue;} ret=mifs_read(g_BlockNO,g_BlockData);//读取块数据 if(ret!=0){::SendMessage((HWND)ThreadParam,WM_MY_MESSAGE_INFO,6,0);continue;} /* ret=mifs_authenticationE2(0x61,g_CardSerialNo, g_SectorNO);//密钥B验证 if(ret!=0){::SendMessage((HWND)ThreadParam,WM_MY_MESSAGE_INFO,7,0);continue;} */ // ret=mifs_initValue(g_BlockNO, g_InitValue);//初始化余额 // if(ret!=0){::SendMessage((HWND)ThreadParam,WM_MY_MESSAGE_INFO,8,0);continue;} // ::Sleep(100); ret=mifs_addValue(g_BlockNO, g_AddValue);//增余额 // ret=mifs_value(0xc1,g_BlockNO,g_AddValue); if(ret>0){::SendMessage((HWND)ThreadParam,WM_MY_MESSAGE_INFO,10,0);continue;} else if(ret<0){::SendMessage((HWND)ThreadParam,WM_MY_MESSAGE_INFO,15,0);break;} ret=mifs_decreaseValue(g_BlockNO, g_DecValue);//减余额 // ret=mifs_value(0xc0,g_BlockNO,g_DecValue); if(ret>0){::SendMessage((HWND)ThreadParam,WM_MY_MESSAGE_INFO,11,0);continue;} else if(ret<0){::SendMessage((HWND)ThreadParam,WM_MY_MESSAGE_INFO,13,0);break;} ret=mifs_readValue(g_BlockNO, &g_ReadValue);//读余额 if(ret!=0){::SendMessage((HWND)ThreadParam,WM_MY_MESSAGE_INFO,9,0);continue;} // Buzzer(2);//蜂鸣(加了蜂鸣之后读卡器会滞后) ::SendMessage((HWND)ThreadParam,WM_MY_MESSAGE_PUT,0,0);//显示结果 //::Sleep(1000); } ::SendMessage((HWND)ThreadParam,WM_MY_MESSAGE_INFO,12,0); g_ReadFlag=0; return 0; } ...展开收缩
(系统自动生成,下载前可以参看下载内容)

下载文件列表

相关说明

  • 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
  • 本站是交换下载平台,提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度
  • 本站已设置防盗链,请勿用迅雷、QQ旋风等多线程下载软件下载资源,下载后用WinRAR最新版进行解压.
  • 如果您发现内容无法下载,请稍后再次尝试;或者到消费记录里找到下载记录反馈给我们.
  • 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
  • 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.
 相关搜索: IC操作 读写器
 输入关键字,在本站1000多万海量源码库中尽情搜索: