[.NET] vb2005的問題?

看板Visual_Basic作者時間17年前 (2008/12/05 15:53), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/3 (看更多)
我想把輸入的字元轉換成ascii碼(7->55 A->65 B->66) EX:7AB 轉成 556566 然後用另外一個for迴圈每兩個抓一組換成16進位 EX:55->37 65->41 ...... 以下是我寫的 但是跑的結果例外 [從字串 "" 至型別 'Long' 的轉換是無效的。] Private Sub butTran_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles butTran.Click Dim a As Integer For i As Integer = 1 To Len(txtKr.Text) a = Asc(Mid(txtKr.Text, i, i)) Next i For j As Integer = 1 To Len(a) Step 2 txtKu.Text &= Hex(Mid(a, j, j + 2)) Next End Sub -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 118.169.201.11
文章代碼(AID): #19EDtmh4 (Visual_Basic)
文章代碼(AID): #19EDtmh4 (Visual_Basic)