Foxtable(狐表)用户栏目专家坐堂 → 求助:德卡IC卡读卡器的应用


  共有3203人关注过本帖树形打印复制链接

主题:求助:德卡IC卡读卡器的应用

帅哥哟,离线,有人找我吗?
晕了快扶我
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:六尾狐 帖子:1207 积分:7224 威望:0 精华:0 注册:2013/3/4 18:02:00
求助:德卡IC卡读卡器的应用  发帖心情 Post By:2015/7/24 15:11:00 [只看该作者]

把dll引用进去后程序出现编译错误,我记得论坛里有高手开发出来过,下面是开发包的地址
http://www.decard.com/Upload/%E4%B8%8B%E8%BD%BD%E4%B8%AD%E5%BF%83/D8%E5%BC%80%E5%8F%91%E5%8C%85-13582561001.rar

求个高手写个简单的范例
[此贴子已经被作者于2015/7/24 15:11:51编辑过]

 回到顶部
帅哥哟,离线,有人找我吗?
大红袍
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2015/7/24 15:40:00 [只看该作者]


 回到顶部
帅哥哟,离线,有人找我吗?
大红袍
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2015/7/24 15:40:00 [只看该作者]

 别人没有读卡器无法帮你写范例的啊。

 回到顶部
帅哥哟,离线,有人找我吗?
晕了快扶我
  4楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:六尾狐 帖子:1207 积分:7224 威望:0 精华:0 注册:2013/3/4 18:02:00
  发帖心情 Post By:2015/7/24 16:20:00 [只看该作者]

以下是引用大红袍在2015/7/24 15:40:00的发言:
 别人没有读卡器无法帮你写范例的啊。

帮我看下咯,这是我全局代码的
Public icdev As Long
Public st As Integer
Public Declare Function add_s Lib "dcrf32.dll" (ByVal i%) As Integer
Public Declare Function dc_init Lib "dcrf32.dll" (ByVal port%, ByVal baud As Long) As Long
Public Declare Function dc_exit Lib "dcrf32.dll" (ByVal icdev As Long) As Integer
Public Declare Function dc_request Lib "dcrf32.dll" (ByVal icdev As Long, ByVal mode%, tagtype As Long) As Integer
Public Declare Function dc_anticoll Lib "dcrf32.dll" (ByVal icdev As Long, ByVal bcnt%, snr As Long) As Integer
Public Declare Function dc_select Lib "dcrf32.dll" (ByVal icdev As Long, ByVal snr As Long, size As Byte) As Integer
Public Declare Function dc_card Lib "dcrf32.dll" (ByVal icdev As Long, ByVal mode%, snr As Long) As Integer
Public Declare Function dc_load_key Lib "dcrf32.dll" (ByVal icdev As Long, ByVal mode%, ByVal secnr%, ByRef nkey As Byte) As Integer
Public Declare Function dc_load_key_hex Lib "dcrf32.dll" (ByVal icdev As Long, ByVal mode%, ByVal secnr%, ByVal nkey As String) As Integer
Public Declare Function dc_authentication Lib "dcrf32.dll" (ByVal icdev As Long, ByVal mode%, ByVal scenr%) As Integer
Public Declare Function dc_read Lib "dcrf32.dll" (ByVal icdev As Long, ByVal adr%, ByVal sdata$) As Integer
Public Declare Function dc_read_hex Lib "dcrf32.dll" (ByVal icdev As Long, ByVal adr%, ByVal sdata$) As Integer
Public Declare Function dc_write Lib "dcrf32.dll" (ByVal icdev As Long, ByVal adr%, ByVal sdata$) As Integer
Public Declare Function dc_write_hex Lib "dcrf32.dll" (ByVal icdev As Long, ByVal adr%, ByVal sdata$) As Integer
Public Declare Function dc_changeb3 Lib "dcrf32.dll" (ByVal adr As Long, ByVal secer As Integer, ByRef KeyA As Byte, ByVal B0 As Integer, ByVal B1 As Integer, ByVal B2 As Integer, ByVal B3 As Integer, ByVal Bk As Integer, ByRef KeyB As Byte) As Integer
Public Declare Function dc_read_allhex Lib "dcrf32.dll" (ByVal icdev As Long, ByVal sdata$) As Integer
Public Declare Function dc_write_allhex Lib "dcrf32.dll" (ByVal icdev As Long, ByVal sdata$) As Integer
Public Declare Function dc_set_autoflag Lib "dcrf32.dll" (ByVal icdev As Long, ByVal flag%) As Integer
Public Declare Function dc_check_writehex Lib "dcrf32.dll" (ByVal icdev As Long, ByVal cardid As Long, ByVal mode As Integer, ByVal adr%, ByVal sdata$) As Integer


Public Declare Function dc_HL_initval Lib "dcrf32.dll" (ByVal icdev As Long, ByVal mode As Integer, ByVal adr%, ByVal value As Long, ByRef snr As Long) As Integer
Public Declare Function dc_HL_increment Lib "dcrf32.dll" (ByVal icdev As Long, ByVal mode As Integer, ByVal adr%, ByVal value As Long, ByVal snr As Long, value As Long, ByRef snr As Long) As Integer
Public Declare Function dc_HL_decrement Lib "dcrf32.dll" (ByVal icdev As Long, ByVal mode As Integer, ByVal adr%, ByVal value As Long, ByVal snr As Long, value As Long, ByRef snr As Long) As Integer

'
Public Declare Function dc_initval Lib "dcrf32.dll" (ByVal icdev As Long, ByVal adr%, ByVal value As Long) As Integer
Public Declare Function dc_readval Lib "dcrf32.dll" (ByVal icdev As Long, ByVal adr%, value As Long) As Integer
Public Declare Function dc_increment Lib "dcrf32.dll" (ByVal icdev As Long, ByVal adr%, ByVal value As Long) As Integer
Public Declare Function dc_decrement Lib "dcrf32.dll" (ByVal icdev As Long, ByVal adr%, ByVal value As Long) As Integer
Public Declare Function dc_restore Lib "dcrf32.dll" (ByVal icdev As Long, ByVal adr%) As Integer
Public Declare Function dc_transfer Lib "dcrf32.dll" (ByVal icdev As Long, ByVal adr%) As Integer
Public Declare Function dc_halt Lib "dcrf32.dll" (ByVal icdev As Long) As Integer

Public Declare Function dc_srd_eepromhex Lib "dcrf32.dll" (ByVal icdev As Long, ByVal adr%, ByVal lenth%, ByVal sdata$) As Integer
Public Declare Function dc_swr_eepromhex Lib "dcrf32.dll" (ByVal icdev As Long, ByVal adr%, ByVal lenth%, ByVal sdata$) As Integer


Public Declare Function dc_reset Lib "dcrf32.dll" (ByVal icdev As Long, ByVal msec%) As Integer
Public Declare Function dc_beep Lib "dcrf32.dll" (ByVal icdev As Long, ByVal time1 As Integer) As Integer


===================================
然后我在窗口的button里写了
If icdev < 0 '如果设备不存在
        icdev = dc_init(100, 115200) '则设置端口,100为USB,115200为波特率
        st = dc_beep(icdev, 30) ‘设置蜂鸣器响声时间
    Else
        st = dc_beep(icdev, 30) ‘设置蜂鸣器响声时间
End If

运行后出错,出错提示为

.NET Framework 版本:2.0.50727.5485
Foxtable 版本:2014.11.11.1
错误所在事件:窗口,窗口1,Button1,Click
详细错误信息:
无法加载 DLL“dcrf32.dll”: 找不到指定的模块。 (异常来自 HRESULT:0x8007007E)。


我已经把dcrf32.dll复制到foxtable的安装目录了,没有引用

 回到顶部
帅哥哟,离线,有人找我吗?
大红袍
  5楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2015/7/24 16:49:00 [只看该作者]

1、代码直接写

 

icdev = dc_init(100, 115200) '则设置端口,100为USB,115200为波特率
st = dc_beep(icdev, 30)

 

2、开发文档介绍的dll,都要拷贝到foxtable的安装目录去,注意,是安装目录,不是项目目录啊


 回到顶部
帅哥哟,离线,有人找我吗?
晕了快扶我
  6楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:六尾狐 帖子:1207 积分:7224 威望:0 精华:0 注册:2013/3/4 18:02:00
  发帖心情 Post By:2015/7/24 20:36:00 [只看该作者]

 我也是醉了,用VB写的蜂鸣器都有响声,用fox写怎么都不响
dc_beep(icdev, 30)

 回到顶部
帅哥哟,离线,有人找我吗?
大红袍
  7楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2015/7/26 10:47:00 [只看该作者]

 1、端口换一个,不要用同一个;

 

 2、看5楼,不可能有问题。


 回到顶部
帅哥哟,离线,有人找我吗?
晕了快扶我
  8楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:六尾狐 帖子:1207 积分:7224 威望:0 精华:0 注册:2013/3/4 18:02:00
  发帖心情 Post By:2015/7/26 16:08:00 [只看该作者]

以下是引用大红袍在2015/7/26 10:47:00的发言:

 1、端口换一个,不要用同一个;

 

 2、看5楼,不可能有问题。

100是USB端口,API文件里说明的
可以远程支持下不?试了好多次,用例子里的VB测试也过得了,真是抓狂了


 回到顶部
帅哥哟,离线,有人找我吗?
大红袍
  9楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2015/7/26 16:20:00 [只看该作者]

 有那么难吗?

 

1、拷贝代码到全局代码;

 

2、运行5楼的代码啊

 

icdev = dc_init(100, 115200) '则设置端口,100为USB,115200为波特率
st = dc_beep(icdev, 30)


 回到顶部
帅哥哟,离线,有人找我吗?
晕了快扶我
  10楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:六尾狐 帖子:1207 积分:7224 威望:0 精华:0 注册:2013/3/4 18:02:00
  发帖心情 Post By:2015/7/26 16:55:00 [只看该作者]

以下是引用大红袍在2015/7/26 16:20:00的发言:

 有那么难吗?

 

1、拷贝代码到全局代码;

 

2、运行5楼的代码啊

 

icdev = dc_init(100, 115200) '则设置端口,100为USB,115200为波特率
st = dc_beep(icdev, 30)

icdev的值能读得出来,就是蜂鸣器不响,
st = dc_beep(icdev, 30)
这句代码好像没用,但是在VB里一模一样的代码蜂鸣器是有响的,所以我觉得很奇怪

 回到顶部
总数 15 1 2 下一页