当前位置:文档之家› 二代身份证读卡器二次开发代码

二代身份证读卡器二次开发代码


While Mid(mf, readname, 1) = " "
readname = readname + 1
Wend
d = readname
i=i+1
End If
readname = readname + 1
Wend
idno1 = Mid(ii(3), 1, 18) '身份证号
sex1 = Mid(idno1, 17, 1) '性别代码
stuname = ii(1)
'姓名
addres = Mid(ii(2), 12) '住址
birthday = Mid(idno1, 7, 4) + "-" + Mid(idno1, 11, 2) + "-" + Mid(idno1, 13, 2) '出生日期
If Int(CInt(sex1) / 2) = CInt(sex1) / 2 Then '性别转换
Public Function FTPTxtFile(site, file) 'ftp 上传 Inet1.URL = "ftp://" & site Inet1.Protocol = icFTP erName = "upphoto" ‘ftp 用户(可改) Inet1.Password = "upphoto" ‘ftp 密码(可改) Inet1.Execute , "PUT c:/aha.bmp " & file ‘上传 c 盘根目录的 aha.bmp 文件 Do While Inet1.StillExecuting
<td width="175" class="color2" > <P align=left> <input size=25 name=fname maxLength=25 >
</P></td> </tr> <tr>
<td class="color2" > <P align=center><FONT size=3>性别:</FONT></P></td> <td class="color2" > <P align=left>
sex1 = "女"
Else
sex1 = "男"
End If
fname.value = stuname
fsex.value = sex1
fbirth.value = birthday
fadd.value = addres
fid.value = idno1
fdep.value=pf
pf=icread.toftp("192.168.2.218",idno1&".bmp") 'ip 为存放身份证照片的服务器 IP 地址,此地址要建 ftp 服
<input size=25 name=fnation maxLength=25 > </P></td> </tr> <tr> <td class="color2" > <P align=center><FONT size=3>出生:</FONT></P></td> <td class="color2" > <P align=left>
Public Function hx_IDname() As String '供外部调用函数 hx_IDname = ostudent() End Function
Public Function toftp(urln, file) '供外部调用函数 Call FTPTxtFile(urln, file) End Function
</OBJECT> <script language=vbscript>
function IC_read() Dim readname, i, d, idno1, sex1, stuname, addres, idno, birthday,mf,pf Dim ii(10) mf=icread.hx_IDname() '通过插内函数读出身份证数据 'msgbox(mf) '显示读出的原内容 内里有民族,身份证有效期等

end if
end function
</script>
<script language="JavaScript"> function res(){ var i = Math.random();
document.getElementById("photoid").src="c:/aha.bmp";} //显示读出的身份证照片 </script>
Put #1, , pf(i) i=i+1 Wend Close #1 Call GetBmp("c:\aha.wlt", 2) ‘调用读卡器函数库 Else MsgBox ("请重放身份证") ostudent = "1" End If End Function
文件 htmok,生成 htmok.ocx லகம் = CLng(mf(i)) * 256 + CLng(mf(i - 1)) i=i+2 bb = bb + ChrW(aa) Wend 'mf = StrConv(mf, 128) '把 Unicode 码转换成 ansi 码 ostudent = bb
'下面提取照片 Open asx & "c:\aha.wlt" For Output As #1 Close #1 Open "c:\Aha.wlt" For Binary As #1 i=0 While i < 1024
if len(Trim(mf))>1 then '是否读出数据
readname = 1
i=1
d=1
While readname < Len(mf) '把读出的数据拆分
If Mid(mf, readname, 1) = " " Then
ii(i) = Mid(mf, d, readname - d)
<table width="471" border="1" cellspacing="0" cellpadding="0" > <tr> <td width="114" class="color2" > <P align=center><FONT size=3>姓名:</FONT></P></td> <td width="174" rowspan="8" class="color2" > <IMG id ="photoid" ></td>
<input size=25 name=fbirth maxLength=25 > </P></td> </tr> <tr> <td class="color2" > <P align=center><FONT size=3>住址:</FONT></P></td> <td class="color2" > <P align=left>
<input size=25 name=fid maxLength=25 > </P></td> </tr> <tr> <td class="color2" > <P align=center><FONT size=3>发证机关:</FONT></P></td> <td class="color2" > <P align=left>
CLASSID="CLSID:900623A9-FF0F-4BAD-9CB7-EE10C761267E" CODEBASE="htmok.CAB#version=1,0,0,0" width=0 height=0 align=center hspace=0 vspace=0
ID="icread" >
<input size=25 name=fadd maxLength=25 > </P></td> </tr> <tr> <td class="color2" > <P align=center><FONT size=3>证号:</FONT></P></td> <td class="color2" > <P align=left>
相关主题