这两天一直在解决这个问题,我已经可以读了,但写进去有问题,已经有一个读写器不知怎的,现在不能用啦!望高手出手

解决方案 »

  1.   

    该接口例子如下:2、VB 6.0
    声明方法:
    函数:Declare Function  函数名 LIB  “动态库文件名(含路径)” (调用参数列表) AS 返回值类型
    过程:Declare Sub 过程名 LIB  “动态库文件名(含路径)” (调用参数列表)
    调用参数中:属于值传送的,前面加 ByVal;属于指针型的,用 As Any。表示。函数声明
    Private Declare Function LinkDevice Lib " hxdxq32.dll" (ByVal devicename As String) As Integer
    Private Declare Function UnlinkDevice Lib " hxdxq32.dll" () As Integer
    Private Declare Function PowerOn Lib " hxdxq32.dll" (ByVal slot As Byte, ByRef recedata As Any, ByRef plen As Long) As Integer
    Private Declare Function PowerOff Lib " hxdxq32.dll" (ByVal slot As Byte, ByRef recedata As Any, ByRef plen As Long) As Integer
    Private Declare Function ReadCard Lib "hxdxq32.dll" (ByVal zone&, ByVal addr&, ByVal rlen&, ByRef recedata As Any, ByRef plen As Long) As Integer
    Private Declare Function WriteCard Lib "hxdxq32.dll" (ByVal zone&, ByVal addr&, ByVal rlen&, ByRef senddata As Any, ByRef recedata As Any, ByRef plen As Long) As Integer
    Private Declare Function ChkSecret Lib "hxdxq32.dll" (ByVal keytype As Byte, ByRef key As Any, recedata As Any, ByRef plen As Long) As Integer
    Private Declare Function ByteToHexStr Lib "hxdxq32.dll" (ByRef senddata As Any, ByVal size&, ByVal recedata As String) As Integer
    Private Declare Function HexStrToByte Lib "hxdxq32.dll" (ByRef senddata As Any, ByRef recedata As Any) As Integer调用例子
    Private Sub Command1_Click()
    Dim strbuf As String * 256
    Dim key(16) As Byte
    Dim senddata(256) As Byte
    Dim recedata(256) As Byte
    Dim i, ErrorCode As Integer
    Dim plen As Long
    Dim tt As Long
    strbuf = String(256, Chr(0))
    key(0) = &HFF
    key(1) = &HFF
    For i = 0 To 255
        senddata(i) = i
    Next
    plen = 0
    ErrorCode = LinkDevice(“COM1”)
    ErrorCode = PowerOn(1, recedata(0), plen)
    ErrorCode = ByteToHexStr(recedata(0), 3, strbuf)
    '按压缩方式读
    ErrorCode = ReadCard(0, 32, 32, recedata(0), plen)
    ErrCode = ByteToHexStr(recedata(0), plen, strbuf)
    ErrorCode = ChkSecret(0, key(0), recedata(0), plen)
    '按压缩方式写
    ErrCode = ByteToHexStr(recedata(0), plen, strbuf)
    ErrorCode = WriteCard(0, 32, 32, senddata(0), recedata(0), plen)
    ErrCode = ByteToHexStr(recedata(0), plen, strbuf)
    ErrorCode = PowerOff(1, recedata(0), plen)
    ErrorCode = UnlinkDevice
    End Sub
      

  2.   

    to:yoki
     有接口例子,上面就是
    TO:809982
     我们公司拿钱购买的,你说为什么不应该提出来,可上面的例子根本解决不了问题
     我不知道你说的合法用户是什么意思
      

  3.   

    不会只有这么一个例子吧,应该有详细的文挡,如果没有的话,可联系厂商,索取sdk