我们都知道asp.net程序是放在服务器上的,但是读卡机是在客户端的,当客户读卡机连接到客户点电脑,我如何通过这个读卡机提供的Dll操作读卡器呢?说白了就是通过网页调用客户端的DLL访问一些外界设备!求各味大虾伸出援手。

解决方案 »

  1.   

    如果你的DLL是COM组件的话,可以通过脚本调用,但可能IE会阻止调用,需要把安全选项设置低一些至于怎么调用COM组件,你可以上网找找
      

  2.   

    说实话,不好实现,相信我。
    做成ocx
      

  3.   

    active 控件, 但是  现在很多浏览器 都再屏蔽它,
      

  4.   

    让asp.net和连接读卡器的计算机位于同一台计算机上。
      

  5.   


    读卡器dll的接口函数: 
      int   open_comm(int   comm_id); 
      int   CardReady(long   *snr); 
    调用的方法是: 
      [DllImport( "...WM_Mifare.dll ",   CharSet   =   CharSet.Ansi)]\\dll是绝对路径 
    public   static   extern   int   open_comm(string       comm_id);             public   int     InitReaderDll(string     comm_id) 
                    {           
                                    return   open_comm(comm_id);         
                    } 
    [DllImport( "E:\\.....WM_Mifare.dll ",   CharSet   =   CharSet.Ansi)]\\dll是绝对路径 
                    public   static   extern   int   CardReady(string   snr);                 public   int   DllReader(string   snr) 
                    {     
                                    return   CardReady(snr); 
                    } 调用指令: 
    private   void   button2_Click(object   sender,   EventArgs   e) 
                    { 
                            this.skclass.InitReaderDll(a); 
                                  this.skclass.DllReader(i); 
                            this.textBox3.Text   =   i; 
                    } 
    int   open_comm(int   comm_id); 
      int   CardReady(long   *snr); 对应: 
    public   static   extern   int   open_comm(int   comm_id); 
    public   static   extern   int   CardReady(ref   long   snr);