1樓:
dim i as integer
text2=""
for i = 1 to len(text1)text2 = text2 + format(hex(asc(mid(text1, i, 1))),"0000")
next
以上為熱心網友的結果,只是為了準確轉換數字與漢字,加了一點東西.
2樓:
text2.text = hex(asc(text1.text))
該死,這樣不行.
3樓:匿名使用者
private sub command1_click()for i = 1 to len(text1.text)n = jinzhizhuanh(asc(mid(text1.text, i, 1)))
jieguo = jieguo & n & " "
next i
text2.text = jieguo
end sub
function jinzhizhuanh(n as integer) as string
dim a(15) as string
b = "0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f"
for i = 0 to 15
a(i) = split(b, ",")(i)next i
do while n > 15
s = int(n / 16)
k = a(n - s * 16) & kn = s
loop
k = a(n) & k
jinzhizhuanh = k
end function
vb中 如何將16進位制的 ascii碼序列 轉換為 字串
4樓:匿名使用者
理論上是對的,可以顯示,但是不能用你的**除錯.
是不是埠傳過來的資料太慢了呢?
這樣測試一下:
u***eera.getdata strdat, vbbyte + vbarray 'winsock接收到的資料 16進位制
dim l as long, m as string, n as string, k as string
dim temparr() as string
for l = 0 to ubound(strdat)
m = hex(strdat(l)) '資料已經轉換為16進位制 肯定沒問題 試過了
n = n & chrw("&h" + m) ’這句我想將字元存成字串,之後無法顯示,請賜教
’n= chrw("&h" + m) 單個字元可以存進來 並且顯示
sleep 500 '暫停一下
next
txtoutput.text = n '我想將存好的字串顯示 如果是n=n+的那個無法顯示
5樓:匿名使用者
我感覺你的chrw沒有問題,問題出在n上,n沒有初值,錯誤不可預見.可以這樣
dim l as long, m as string, n as string, k as string
n = ""
dim temparr() as string......應該就沒問題了
補充:換成
或試試
6樓:
先得出,後反向字串的函式,再不管用兩個一塊上,咋?
7樓:匿名使用者
把這句改一下試試:
n=n+chrw()
改為n=n & chrw()
如何將vb中的字串轉換成ascii碼
8樓:寒信
dim i as integer, str as string, ascstr as string
str = inputbox("請輸入字串")for i = 1 to len(str)ascstr = ascstr & cstr(asc(mid(str, i, 1)))
next i
print ascstr
c怎麼把byte陣列轉換為字串
實現位元組陣列至十六進位制字串轉換,這個操作在接收網路資料時非常有用,嘛,就一行,就一行,就一行 string str bitconverter.tostring bytes 司馬刀劍 有兩張方法 方法一 字串轉byte string stringmessage how are you?consol...
將十進位制整數轉換成16進位制字串的程式
轉換成二進位制字串 public function getbinary byval dec as integer dim str b as string str b do while dec 0 str b trim str dec mod 2 str b dec int dec 2 loop ge...
在sql語句中,出現將字串轉換為uniqueidentifier時失敗的錯誤
select from dbo.sys userinfowhere id in select cast strone as uniqueidentifier as strone from v leadervoteinfo where lvititle 測試資料 28a0cd1a 8641 4cf3 ...