<SCRIPT ID=clientEventHandlersJS LANGUAGE=javascript> var str1; function OnInitialize() { HWIDCard1.HWInitScanner("C://Test.jpg"); HWIDCard1.SaveLittleImg = 1; } function OnCalibrate() { HWIDCard1.HWCalibrate(); } function OnScan(CardType) { HWIDCard1.HWScan(CardType); } </SCRIPT> <!--OnScanFinish(type)扫描结束后引发的事件--> <SCRIPT LANGUAGE=javascript FOR=HWIDCard1 EVENT=OnScanFinish(type)> //身份证 if ((type == 3) || (type == 6)) { testForm.T1.value = HWIDCard1.IDName; testForm.T2.value = HWIDCard1.IDNumber; testForm.T3.value = HWIDCard1.IDSex; testForm.T4.value = HWIDCard1.IDBirthday; testForm.S1.value = HWIDCard1.IDAdrr; } //驾驶证 if (type == 2) { testForm.T1.value = HWIDCard1.IDName; testForm.T2.value = HWIDCard1.IDNumber; testForm.T3.value = HWIDCard1.CarType; testForm.T4.value = HWIDCard1.IDSignDate; testForm.S1.value = HWIDCard1.IDAdrr; } //护照 if (type == 1) { testForm.S1.value = HWIDCard1.PassportNo; } //获取图像信息 str1=HWIDCard1.HWGetImageContent(); testForm.ImgContent.value = str1; alert(str1.length); testForm.submit(); </SCRIPT> </head> <body> <!--Object标签调用Activex对象--> <object classid="CLSID:AA784F0F-90DF-44A1-A38D-532813B541B8" width="32" height="32" id="HWIDCard1"> <embed width="32" height="32"></embed> </object>