string转二进制的函数吗?
Public Function BinConvert(textdata As String) As String
Dim i As Integer
Dim chrdata As String
BinConvert = ""
For i = 1 To Len(textdata)
chrdata = Mid(textdata, i, 1)
If chrdata <> Chr(13) Then
If chrdata = "$" Then
If IsHex(Mid(textdata, i + 1, 2)) Then
chrdata = Mid(textdata, i + 1, 2)
BinConvert = BinConvert & Chr(Val("&H" + chrdata))
i = i + 2
Else
BinConvert = BinConvert & chrdata
End If
Else
BinConvert = BinConvert & chrdata
End If
End If
Next i
End Function