文本型字符:68797F7100000000private Declare Function SystemInitialization Lib "MakeCard.dll" (ByRef password As Integer) As IntegerDim buf(7) As Integer '保存客户参数缓冲区call SystemInitialization(buf(0))
怎么把上面的文本型字符转换为BUF的数组我这段的文本的由来是
private Declare Function ReadSystemPas Lib "MakeCard.dll" (ByRef password As Integer) As Integer
call ReadSystemPas(buf(0))str=cdata(buf) '就得出上面那段字符了Public Function CData(B() As Integer) As String
Dim Str As String
Dim I As Integer
Str = ""
For I = 0 To 7
If Len(Hex(B(I))) = 2 Then
Str = Str + Hex(B(I))
Else
Str = Str + "0" + Hex(B(I))
End If
Next I
CData = Str
End Function我不想每次运行软件都读取一次数据到BUF数组中
我想把文本字符设定到程序中,只须使用SystemInitialization(buf(0))就行了
解决方案 »
- 难度10:压缩数据,然后解压数据包,不要文件格式,怎么做?
- 串口通讯郁闷之极的小问题
- 如何自动创建一个数据库并添加主键呢?最好是那种自动递增的.
- 在线等,急急急!!!关于数据库备份问题
- 放分贴(5),多谢flxa帮助,,其他人不用进来
- 怎么打开加了密码的access2000数据库
- 请大家帮忙如何用VB实现将一个数据源的某张表内容导入另一个数据源中,两个ADO分别连接不同机器的SQL server
- 毕业一年后,我的第一次抉择,请赐教
- 一个关于路径的问题。
- 请问,SQL SERVER问题?
- 菜鸟问题:vb里如何定义有缺省参数的函数
- VB6中如何判断两个引用指向地是同一个对象? (请注意不是对象的值相等)
Public Function CData(B() As Integer) As String
Dim Str As String
Dim I As Integer
Str = ""
For I = 0 To 7
If Len(Hex(B(I))) = 2 Then
Str = Str + Hex(B(I))
Else
Str = Str + "0" + Hex(B(I))
End If
Next I
CData = Str
End Function
Dim i As Integer
For i = 0 To 7
b(i) = CInt("&H" & Mid(S, i * 2 + 1, 2))
Next i
End SubPrivate Sub Form_Load()
Dim b(7) As Integer, i As Integer
CData2 "68797F7100000000", b
For i = 0 To 7
Debug.Print b(i)
Next i
End Sub