读书人

下列VB的代码怎么改为PB的代码

发布时间: 2012-02-28 13:06:35 作者: rapoo

下列VB的代码如何改为PB的代码
dim src() As Byte
dim ln As Integer)
Dim i As Integer
Dim st As String
Dim temp As Integer
ln = 100
For i = 0 To ln - 1
temp = src(i) \ 16
If temp > 9 Then
temp = temp + 55
Else
temp = temp + 48
End If
st = st & Chr(temp)

temp = src(i) Mod 16
If temp > 9 Then
temp = temp + 55
Else
temp = temp + 48
End If
st = st & Chr(temp)
Next

[解决办法]
你用中文翻译一下呢?

貌似是个循环求ascii码的事情.
[解决办法]

C# code
Arry src() Integer ln,i,temp String st   ln = 100  For i = 0 To ln - 1  temp = src(i) \ 16  If temp > 9 Then  temp = temp + 55  Else  temp = temp + 48  End If  st = st & Char(temp) --?      temp = src(i) Mod 16  If temp > 9 Then  temp = temp + 55  Else  temp = temp + 48  End If  st = st & Chr(temp)  ---?  Next
[解决办法]
C# code
//函数功能:取字符串 ls_s 对应的十六进制串string ls_s = "你好"char src[]Integer ln Integer istring stInteger temp//ln = 100 //这个不要,for循环中用upperbound来取上限//加一句,对src进行赋值src = ls_sFor i = 1 To upperbound(src)  temp = asc(src[i]) / 16  If temp > 9 Then        temp = temp + 55  Else        temp = temp + 48  End If  st = st + char(temp)      temp = Mod(asc(src[i]), 16)  If temp > 9 Then        temp = temp + 55  Else        temp = temp + 48  End If  st = st + Char(temp)Nextmessagebox('',st) //“你好”对应的十六进制为“C4E3BAC3” 

读书人网 >PB

热点推荐