找回密码
 加入
搜索
查看: 1817|回复: 2

[AU3基础] 包含结束符的字符串如何处理

[复制链接]
发表于 2012-7-18 21:31:54 | 显示全部楼层 |阅读模式
代码:
Global Const $SCARD_SCOPE_USER = 0
Dim $hContext
Dim $pcchReaders = 500
Dim $szReaderList
$dll = DllOpen("WinScard.dll")
if @error Then MsgBox(0,"1","Fail Load")
$result = DllCall($dll, "long", "SCardEstablishContext","long",$SCARD_SCOPE_USER,"long",0,"long",0,"long*",$hContext)
$hContext = $result[4];
if @error Then 
    MsgBox(0,"2","Fail" & @error & $hContext & $result)
    DllClose($dll)
    Exit
EndIf
$result = DllCall($dll, "lparam", "SCardListReaders","long",$hContext,"str","","STR",$szReaderList,"long*",$pcchReaders)
if @error Then 
    MsgBox(0,"3","Fail" & $pcchReaders & $result)
    DllClose($dll)
    Exit
EndIf
MsgBox(0,"", $result[3])
DllClose($dll)
问题描述:
在调用SCardListReaders时,第三个参数用于返回智能卡名字的字符串,但因为存在多个智能卡,所以这个字符串中包含了结束符。
直接使用返回的字符串,即$result[3],只能显示第一个智能卡名字,后面的名字被字符串自动截掉了。
请教 :这种情况下,如何把各智能卡名字分别存储在不同的string里面
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-11-15 12:41 , Processed in 0.084867 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表