|
begin process at 2008 07 20 10:23:15
Derniers logiciels
|
Trouver une ressource (Nouvelle version du moteur, plus rapide & pertinent, essayez le !)
Vous ne trouvez pas de réponse à votre problème ? Alors posez la question dans le forum.
Souvenez-vous qu'il n'y a jamais de question bête, mais rester dans l'ignorance parce que l'on n'ose pas poser une question, ça c'est une erreur !
Sujet : ativex et mastrepage [ Système / ActiveX ] (io_ost)
|
ativex et mastrepage
le 02/08/2006 12:03:40
|
|
Re : ativex et mastrepage
le 04/08/2006 11:22:53
|
|
Re : ativex et mastrepage
le 04/08/2006 12:20:31

io_ost
Membre Club 
|
tu as raison j'ai essayer de tourner ça comme ça : j'avais une balise : < table... que j'ai mis dans le contentplacehoder qui contient tout mes <imput...
pour remplacer : <bodyclass="normal"onload="setTimeout('sprox_startup()', 500)">
j'ai fais : function window_onload() {sprox_startup(); } et lors du chargement de ma page cela me dit que l'imput nanan est indéfini code 0 alors que c'est le deuxième imput de type text qui est sur ma page et tout s'arrête : là pas de connexion avec mon lecteur de carte je ne vois pas ce que je fais de travers !!
|
|
|
|
Re : ativex et mastrepage
le 04/08/2006 12:25:49
|
|
Re : ativex et mastrepage
le 04/08/2006 13:59:34
|
|
Re : ativex et mastrepage
le 04/08/2006 14:48:47

io_ost
Membre Club 
|
pas de problème : mais il va te manquer la dll c juste la page de test du lecteur la mienne est pareil que je souhaite réutiliser (mais dans une master page) <% @PageLanguage="VB"AutoEventWireup="false"CodeFile="springprox.aspx.vb"Inherits="springprox" %><! DOCTYPEhtmlPUBLIC"-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">< htmlxmlns="http://www.w3.org/1999/xhtml">< headrunat="server"><title></title> < scriptlanguage="javascript"><!-- /* * global variables telling what's the current status */ var sprox_ocx_ok = false; // becomes true when the OCX has been loaded and activatedvar sprox_rdr_ok = false; // becomes true when the Reader has been openedvar sprox_tag_ok = false; // becomes true when a tag has been found on the reader (14443 layer 3)var sprox_tcl_ok = false; // becomes true when a T=CL card has been found on the reader (14443 layer 4)/* * utility function */ function show_status(s) {if (s != false) {sprox_status.value = s; } window.status = sprox_status.value; } function check_valid(s,a) {for (var i=0; i<s.length; i++) {if (a.indexOf(s.charAt(i)) == -1)returnfalse;} returntrue;} function check_hexa(s) {return check_valid(s, '0123456789ABCDEFabcdef'); } function qrt_to_hex(q) {if (q > 15)returnfalse;return'0123456789ABCDEF'.charAt(q);} function byte_to_hex(c) {if (c > 255)returnfalse;return qrt_to_hex(c / 16) + qrt_to_hex(c % 16);} function string_to_hex(s) {var h = '';for (var i=0; i<s.length; i++) {h = h + byte_to_hex(s.charCodeAt(i)); } return h;} function sprox_startup(){ show_status( 'Looking for SpringProx OCX...');if (!(document.all)){ show_status( 'This browser does not support ActiveX controls');returnfalse;} if (!(sprox_ocx)){ show_status( 'SpringProx OCX not installed, or not accepted by navigator security rules');returnfalse;} show_status( 'Loading SpringProx OCX...');try{ if (sprox_ocx.Library == undefined){ show_status( 'SpringProx OCX not active : failed to load the springprox.dll library');returnfalse;} } catch (e){ show_status(e.message); show_last_error(); returnfalse;} sprox_library.value = sprox_ocx.Library; sprox_ocx_ok = true;show_status( 'SpringProx OCX active, now looking for the SpringProx or CSB reader...');try{ sprox_ocx.Open(); sprox_ocx.RfField = false;} catch (e){ show_status(e.message); show_last_error(); alert( 'SpringProx OCX active, but no reader has been found. Please check your hardware.');returnfalse;} show_status( 'SpringProx OCX active, reader found, now receiving product infos...');sprox_device.value = sprox_ocx.Device; sprox_firmware.value = sprox_ocx.Firmware; show_status( 'Reader found. You can now select a tag.');sprox_rdr_ok = true;show_last_error(); returntrue; } function show_last_error(){ try{ if (sprox_ocx.LastError == 0){ sprox_lasterror.value = '';} else{ sprox_lasterror.value = sprox_ocx.LastError + " ==> " + sprox_ocx.LastErrorTxt;} } catch (e){ sprox_lasterror.value = '';} } function btn_selectTag(){ if (!sprox_rdr_ok){ show_status( 'Reader not found');return;} sprox_tag_ok = false;sprox_tcl_ok = false;sprox_tag_snr.value = '';sprox_tag_atq.value = '';sprox_tag_sak.value = '';sprox_tag_ats.value = '';sprox_tag_type.value = '';sprox_block_0.value = '';sprox_block_1.value = '';sprox_block_2.value = ''; sprox_block_0_str.value = '';sprox_block_1_str.value = '';sprox_block_2_str.value = ''; try{ sprox_ocx.RfField = true;} catch (e){ } show_status( 'Looking for a tag...');try{ // Layer 3 activationsprox_ocx.TagSelect (); if (sprox_ocx.LastError == 0){ show_status( 'Tag activated');sprox_tag_snr.value = sprox_ocx.TagSnr; sprox_tag_atq.value = sprox_ocx.TagAtq; sprox_tag_sak.value = sprox_ocx.TagSak; sprox_tag_ok = true;} else{ show_status( 'No tag found');} } catch (e){ show_status(e.message); } if (sprox_tag_ok){ var sak = eval('0x' + sprox_tag_sak.value);if (sak & 0x20){ try{ // Layer 4 activationsprox_ocx.TclSelect(); if (sprox_ocx.LastError == 0){ show_status( 'T=CL tag activated');sprox_tag_ats.value = sprox_ocx.TclAts; sprox_tcl_ok = true;} else{ show_status( 'T=CL activation failed');} } catch (e){ show_status(e.message); } if (!sprox_tcl_ok){ if (sprox_ocx.LastError == -152){ // Second trytry{ sprox_ocx.TclSelect(); if (sprox_ocx.LastError == 0){ show_status( 'T=CL tag activated');sprox_tag_ats.value = sprox_ocx.TclAts; sprox_tcl_ok = true;} else{ show_status( 'T=CL activation failed');} } catch (e){ show_status(e.message); } } } } } show_last_error(); } function btn_tagHalt(){ if (!sprox_rdr_ok){ show_status( 'Reader not found');return;} sprox_tag_snr.value = '';sprox_tag_atq.value = '';sprox_tag_sak.value = '';sprox_tag_ats.value = ''; sprox_block_0.value = '';sprox_block_1.value = '';sprox_block_2.value = ''; sprox_block_0_str.value = '';sprox_block_1_str.value = '';sprox_block_2_str.value = ''; if (!sprox_tag_ok)return;if (sprox_tcl_ok){ show_status( 'Delecting the tag...'); try{ sprox_ocx.TclDeselect(); show_status( 'T=CL tag halted. You can now select another tag.');} catch (e){ show_status(e.message); } } else{ show_status( 'Halting the tag...'); try{ sprox_ocx.TagHalt(); show_status( 'Tag halted. You can now select another tag.');} catch (e){ show_status(e.message); } } sprox_tag_ok = false;sprox_tcl_ok = false;show_last_error(); } function btn_readSect (){ if (!sprox_tag_ok){ show_status( 'No tag selected');return;} var n = sprox_sector.value;show_status( 'Reading sector ' + n + '...');sprox_block_0.value = '';sprox_block_1.value = '';sprox_block_2.value = ''; sprox_block_0_str.value = '';sprox_block_1_str.value = '';sprox_block_2_str.value = ''; try{ sprox_ocx.MifKeyRead = sprox_read_key.value; sprox_ocx.SectorData= "";sprox_ocx.ReadSector(n); if (sprox_ocx.LastError == 0){ var str;str = sprox_ocx.SectorData; sprox_block_0.value = str.substring(0, 32); sprox_block_1.value = str.substring(32, 64); sprox_block_2.value = str.substring(64, 96); str = sprox_ocx.SectorDataTxt; sprox_block_0_str.value = str.substring(0, 15); sprox_block_1_str.value = str.substring(16, 31); sprox_block_2_str.value = str.substring(32, 47); show_status( 'Sector ' + n + ' is on display');} else{ show_status( 'Failed to read sector ' + n);} sprox_ocx.SectorData= "";} catch (e){ show_status(e.message); } show_last_error(); } function btn_writeSect(){ if (!sprox_tag_ok){ show_status( 'No tag selected');return;} if (sprox_block_0.value.length != 32){ show_status( "Block 0 must hold 16 bytes");return;} if (sprox_block_1.value.length != 32){ show_status( "Block 1 must hold 16 bytes");return;} if (sprox_block_2.value.length != 32){ show_status( "Block 2 must hold 16 bytes");return ;} var str = sprox_block_0.value + sprox_block_1.value + sprox_block_2.value;if (!check_hexa(str)){ alert( "Block fields must hold hexadecimal values (0 to 9 and A to F) !");return;} var n = sprox_sector.value;show_status( 'Writing sector ' + n + '...'); try{ sprox_ocx.SectorData = str; str = sprox_ocx.SectorDataTxt; sprox_block_0_str.value = str.substring(0, 15); sprox_block_1_str.value = str.substring(16, 31); sprox_block_2_str.value = str.substring(32, 47); sprox_ocx.MifKeyWrite = sprox_write_key.value; sprox_ocx.WriteSector(n); if (sprox_ocx.LastError == 0){ show_status( 'Write sector ' + n + ' OK, reading back...');btn_readSect(); } else{ show_status( 'Failed to write sector ' + n);} } catch (e){ show_status(e.message); } show_last_error(); } function btn_tclExchange(){ if (!sprox_tcl_ok){ show_status( 'No T=CL tag selected');return;} sprox_tcl_recv.value = '';try{ sprox_ocx.TclData = sprox_tcl_send.value; } catch (e){ show_status(e.message); return;} try{ sprox_ocx.TclExchange(); if (sprox_ocx.LastError == 0){ show_status( 'Exchange OK');sprox_tcl_recv.value = sprox_ocx.TclData; } else{ show_status( 'Exchange failed');} } catch (e){ show_status(e.message); } show_last_error(); } function btn_LedCtrl(r, g, y){ try{ if (r != -1) sprox_ocx.LedRed = r;if (g != -1) sprox_ocx.LedGreen = g;if (y != -1) sprox_ocx.LedYellow = y;} catch (e){ } } function btn_KeysE2(){ try{ show_status( 'Loading default keys A to EEPROM');sprox_ocx.LoadKey( true, false, 0, 'A0A1A2A3A4A5');sprox_ocx.LoadKey( true, false, 1, 'FFFFFFFFFFFF');sprox_ocx.LoadKey( true, false, 2, '000000000000');sprox_ocx.LoadKey( true, false, 3, 'DEMO_A');sprox_ocx.LoadKey( true, false, 4, 'TEST_A');show_status( 'Loading default keys B to EEPROM');sprox_ocx.LoadKey( true, true, 0, 'B0B1B2B3B4B5'); sprox_ocx.LoadKey( true, true, 1, 'FFFFFFFFFFFF');sprox_ocx.LoadKey( true, true, 2, '000000000000');sprox_ocx.LoadKey( true, true, 3, 'DEMO_B');sprox_ocx.LoadKey( true, true, 4, 'TEST_B'); show_status( 'Done');} catch (e){ //show_status(e.message);} show_last_error(); } function click_EnterAscii(n) {var s, h;switch (n){ case 0 : s = sprox_block_0_str.value; break;case 1 : s = sprox_block_1_str.value; break;case 2 : s = sprox_block_2_str.value; break;} s = prompt( "Saisir une valeur", s);if (!s)returnfalse;switch (n){ case 0 : sprox_block_0_str.value = s; break;case 1 : sprox_block_1_str.value = s; break;case 2 : sprox_block_2_str.value = s; break;} h = string_to_hex(s); while (h.length < 32) { h = h + '00'; }switch (n){ case 0 : sprox_block_0.value = h; break;case 1 : sprox_block_1.value = h; break;case 2 : sprox_block_2.value = h; break;} returnfalse;} //--> </ script></ head>< bodyclass="normal"onload="setTimeout('sprox_startup()', 500)">< objectid="sprox_ocx"classid="CLSID:BCFCEAE4-8632-48F8-AE67-BFF62E36A5E4"height="0"width="50"></object>< tablewidth="100%">< tr><tdclass="title"colspan="4"></td></ tr>< tr><tdclass="subtitle"colspan="4">Interface information </td></ tr>< tr><tdclass="label">SpringProx.dll release :</td><td><inputclass="field_rof"readonlytype="text"name="sprox_library"style="width: 500px;"/></td></ tr>< tr><tdclass="label">Status :</td><td><inputclass="field_ro"readonlytype="text"name="sprox_status"style="width: 500px;"/></td></ tr>< tr><tdclass="label">Last error :</td><td><inputclass="field_ro"readonlytype="text"name="sprox_lasterror"style="width: 500px;"/></td></ tr>< tr><tdclass="subtitle"colspan="4">Device information </td></ tr>< tr><tdclass="label">Reader device :</td><td><inputclass="field_rof"readonly="readonly"type="text"name="sprox_device"style="width: 500px;"/></td></ tr>< tr><tdclass="label">Reader firmware :</td><td><inputclass="field_rof"readonly="readonly"type="text"name="sprox_firmware"style="width: 500px;"/></td></ tr>< tr><tdclass="subtitle"colspan="4">ISO 14443-A tag activation </td></ tr>< tr><tdclass="label">ISO 14443-3 level :</td><td>SNR : <inputclass="field_rof"readonlytype="text"name="sprox_tag_snr"size="20"/>ATQ : <inputclass="field_rof"readonlytype="text"name="sprox_tag_atq"size="10"/>SAK : <inputclass="field_rof"readonlytype="text"name="sprox_tag_sak"size="10"/></td></ tr>< tr><tdclass="label">ISO 14443-4 level :</td><td>ATS : <inputclass="field_rof"readonlytype="text"name="sprox_tag_ats"size="40"/></td></ tr>< tr><tdclass="label">Identified tag :</td><td><inputclass="field_rof"readonly="readonly"type="text"name="sprox_tag_type"size="40"/></td></ tr>< tr><tdclass="label"> </td><td><inputclass="button"type="button"name="button_Select_Tag"value="Select Tag"onclick="btn_selectTag();"id="Button1"/><inputclass="button"type="button"name="button_Halt_Tag"value="Halt Tag"onclick="btn_tagHalt();"/><inputid="Button2"type="button"value="button"onclick="btn_selectTag();"/></ tr>< tr><tdclass="subtitle"colspan="4">Mifare classic 1k or 4k sample application </td></ tr>< tr><tdclass="label">Read access key :</td><td><inputtype="text"name="sprox_read_key"size="20"/>(leave blank to use reader's internal keys) </td></ tr>< tr><tdclass="label">Write access key :</td><td><inputtype="text"name="sprox_write_key"size="20"/>(leave blank to use reader's internal keys) </td></ tr>< tr><tdclass="label">Read / write a sector :</td><td><selectname="sprox_sector"><optionvalue="0"selected>0</option><optionvalue="1">1</option><optionvalue="2">2</option><optionvalue="3">3</option><optionvalue="4">4</option><optionvalue="5">5</option><optionvalue="6">6</option><optionvalue="7">7</option><optionvalue="8">8</option><optionvalue="9">9</option><optionvalue="10">10</option><optionvalue="11">11</option><optionvalue="12">12</option><optionvalue="13">13</option><optionvalue="14">14</option><optionvalue="15">15</option></select></td></ tr>< tr><tdclass="label"style="height: 27px">Sector's block 0 :</td><tdstyle="height: 27px"><inputclass="fieldf"type="text"name="sprox_block_0"style="width: 300px;"/></td></ tr>< tr><tdclass="label"> </td><td><inputclass="field_rof"type="text"name="sprox_block_0_str"style="width: 300px;"/><ahref="#"onClick="click_EnterAscii(0);">...</a></td></ tr>< tr><tdclass="label">Sector's block 1 :</td><td><inputclass="fieldf"type="text"name="sprox_block_1"style="width: 300px;"/></td></ tr>< tr><tdclass="label"> </td><td><inputclass="field_rof"type="text"name="sprox_block_1_str"style="width: 300px;"/><ahref="#"onClick="click_EnterAscii(1);">...</a></td></ tr>< tr><tdclass="label">Sector's block 2 :</td><td><inputclass="fieldf"type="text"name="sprox_block_2"style="width: 300px;"/></td></ tr>< tr><tdclass="label"> </td><td><inputclass="field_rof"type="text"name="sprox_block_2_str"style="width: 300px;"/><ahref="#"onclick="click_EnterAscii(2);">...</a></td></ tr>< tr><tdclass="label"> </td><td><inputclass="button"type="button"name="button_ReadSector"value="Read"onclick="btn_readSect();"id="Button4"/><inputclass="button"type="button"name="button_WriteSector"value="Write"onclick="btn_writeSect();"/><inputid="Button3"type="button"value="button"onclick="btn_readSect();"/></td></ tr>< tr><tdclass="subtitle"colspan="4">T=CL Exchange </td></ tr>< tr><tdclass="label">Frame to send to the card :</td><td><inputclass="fieldf"type="text"name="sprox_tcl_send"style="width: 500px;"/></td></ tr>< tr><tdclass="label">Frame returned by the card :</td><td><inputclass="field_rof"type="text"name="sprox_tcl_recv"style="width: 500px;"/></td></ tr>< tr><tdclass="label"> </td><td>< | | |
|