VB Simple Ascii to Hex Convertor + Source
VB.Net 字串轉換成機械馬(Array of Bytes)
轉自:http://www.gamersoul.com/forums/showthread.php?123800-Simple-Ascii-to-Hex-Convertor-Source
Source:
2 Textboxes (name one inputASCII, and the other outputHEX)
2 Buttons (name one btnClear, and the other btnCopy
轉自:http://www.gamersoul.com/forums/showthread.php?123800-Simple-Ascii-to-Hex-Convertor-Source
I'm trying out some stuff on vb.NET cause it's fun to do :D
Download exe
Download exe
Source:
2 Textboxes (name one inputASCII, and the other outputHEX)
2 Buttons (name one btnClear, and the other btnCopy
Code:
Public Class Form1
Private Sub inputASCII_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles inputASCII.TextChanged
Dim str As String
Dim byteArray() As Byte
Dim asciihexOUT As System.Text.StringBuilder = New System.Text.StringBuilder
str = inputASCII.Text
byteArray = System.Text.ASCIIEncoding.ASCII.GetBytes(str)
For i As Integer = 0 To byteArray.Length - 1
asciihexOUT.Append(byteArray(i).ToString("X") + (" "))
Next
outputHEX.Text = (asciihexOUT.ToString())
End Sub
Private Sub btnClear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClear.Click
inputASCII.Text = Nothing
End Sub
Private Sub btnCopy_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCopy.Click
Clipboard.SetText(outputHEX.Text)
End Sub
End Class
我覺得i.Hex 會比較專業
回覆刪除