问题描述
我在做二次开发的时候,用的KRF-35读卡器,不知道M1IC非接触卡里的数据如何读出来,参考了帮助文档和函数说明还是不明白,请教有经验的朋友指导下,我想读出卡里的值,如需读出,扇区1、块1里的数据怎么写,还有增加、减少值、修改密码等,因做一卡通的开发,需在不同的扇区读、写数据进去。
解决方案
解决方案二:
那你直接找厂家要开发包,开发示例。
解决方案三:
明华读卡器我以前做过4442卡接触式开发,想来非接触式的函数应该差不多,把重点代码发给你参考一下。DeclareFunctionsrd_4442_hexLib"mwic_32.dll"Alias"srd_4442"(ByValicdevAsInteger,ByValoffsetAsShort,ByValleAsShort,ByRefdata_buffAsByte)AsShortDeclareFunctionswr_4442_hexLib"mwic_32.dll"Alias"swr_4442"(ByValicdevAsInteger,ByValoffsetAsShort,ByValleAsShort,ByRefdata_buffAsByte)AsShortDeclareFunctionsrd_4442Lib"mwic_32.dll"(ByValicdevAsInteger,ByValoffsetAsShort,ByValleAsShort,ByValdata_buffer$)AsIntegerDeclareFunctionswr_4442Lib"mwic_32.dll"(ByValicdevAsInteger,ByValoffsetAsShort,ByValleAsShort,ByValdata_buffer$)AsIntegerDeclareFunctioncsc_4442Lib"mwic_32.dll"(ByValicdevAsInteger,ByValleAsShort,ByRefdata_bufferAsByte)AsShortDeclareFunctionwsc_4442Lib"mwic_32.dll"(ByValicdevAsInteger,ByValleAsShort,ByRefdata_bufferAsByte)AsShortDeclareFunctionrsc_4442Lib"mwic_32.dll"(ByValicdevAsLong,ByValleAsInteger,ByRefdata_bufferAsByte)AsIntegerDeclareFunctionic_encryptLib"mwic_32.dll"(ByValkeyAsString,ByValptrsourceAsString,ByValleAsShort,ByRefptrdestAsByte)AsShortDeclareFunctionic_decryptLib"mwic_32.dll"(ByValkeyAsString,ByRefptrdestAsByte,ByValleAsShort,ByValptrsourceAsString)AsShortDeclareFunctionrsct_4442Lib"mwic_32.dll"(ByValicdevAsInteger,ByRefcounterAsShort)AsShortDeclareFunctionauto_initLib"mwic_32.dll"(ByValport%,ByValbaudAsInteger)AsIntegerDeclareFunctionget_statusLib"mwic_32.dll"(ByValxAsInteger,ByRefxAsShort)AsShortDeclareFunctionturn_onLib"mwic_32.dll"(ByValicdevAsLong)AsIntegerDeclareFunctionturn_offLib"mwic_32.dll"(ByValicdevAsLong)AsIntegerDeclareFunctiondv_beepLib"mwic_32.dll"(ByValicdevAsInteger,ByValtimeAsShort)AsShortDeclareFunctionic_exit%Lib"mwic_32.dll"(ByValicdevAsLong)DeclareFunctionchk_4442Lib"mwic_32.dll"(ByValicdevAsInteger)AsShortDeclareFunctionasc_hexLib"mwic_32.dll"(ByValasc$,ByRefhexAsByte,ByValleAsInteger)AsShort'写卡函数******************************************PublicFunctioncard_write(ByValicdevAsInteger,ByValmimaAsString,ByValmingwenAsString,ByValoffsetAsInteger,ByVallengthAsInteger)Dimdata_wAsNewString(CChar(""),length)Dimmiwenzu(length-1)AsByteIfic_encrypt(mima,mingwen,length,miwenzu(0))<>0Then'--------------重点Return-1ExitFunctionEndIfIfswr_4442_hex(icdev,offset,length,miwenzu(0))<>0Then'----------------重点Return-2ExitFunctionEndIfReturn0EndFunction'读卡函数***************************************PublicFunctioncard_read(ByValmimaAsString,ByRefmingwenAsString,ByValoffsetAsInteger,ByVallengthAsInteger,ByValicdevAsInteger)'读操作,先读取,再解密Dimmiwenzu(length-1)AsByteDimData_rAsNewString(CChar(""),length)'Dimdata_rAsString=Space(length)Ifsrd_4442_hex(icdev,offset,length,miwenzu(0))<>0Then'-------------重点Return-1ExitFunctionEndIf'解密Ific_decrypt(mima,miwenzu(0),length,Data_r)<>0Then'-----------重点Return-2ExitFunctionEndIfmingwen=Data_r.ToStringReturn0EndFunction
解决方案四:
呵呵以前做过,厂家提供的一张破光盘,里面的代码不好使,不过google能找到一个靠谱的。应该是从一个现成的会员卡管理系统中找出来的。