Disini saya menggunakan Visual Basic 6.0
- Pertama buka VB 6.0
- New Project standard EXE
- Buat 2 buah label ( Ascii & Hexa ), 2 buah TextBox, 2 Buah Command Button
- Langsung eksekusi gan...
- Jalankan dengan menekan tombol F5
Dobel Klik Di Form1 dan copas code berikut :
Dim tulis As String
Dim tblString(183), tblHex(183) As Variant
Dim i As Integer
Sub descTblString()
For i = 1 To 183
tblString(i) = Chr(i)
Next
End Sub
Sub descTblHex()
For i = 0 To 183
tblHex(i) = Hex(i)
Next
End Sub
Private Function HexString(EvalString As String) As String
Dim intStrLen As Integer
Dim intLoop As Integer
Dim strHex As String
EvalString = Trim(EvalString)
intStrLen = Len(EvalString)
For intLoop = 1 To intStrLen
strHex = strHex & Hex(Asc(Mid(EvalString, intLoop, 1)))
Next
HexString = strHex
End Function
Private Sub Command1_Click()
If Text1 = "" Then
MsgBox "Harap Isi Kolom Ascii", vbCritical
Text1.SetFocus
Else
Text2 = HexString(Text1)
End If
End Sub
Private Sub Command2_Click()
Text2.Text = “”
Text1.Text = “”
End Sub
Private Sub Form_Activate()
tulis = "---==" & Form1.Caption
End Sub
Private Sub Picture1_Click()
Picture1.Visible = False
End Sub
tulis = Right(tulis, Len(tulis) - 1) & Left(tulis, 1)
Form1.Caption = tulis
End Sub
Private Sub convertstring()
Dim idx As Integer
m = Len(Text1)
For i = 1 To m
cHex = Mid(Text1, i, 2)
i = i + 1
For idx = 1 To 183
If tblHex(idx) = cHex Then
Text2 = Text2 + tblString(idx)
End If
Next
Next
End Sub
Done...
4 komentar:
CROOOTTT
silahkan di pelajari dan jangan lupa di share. kzkzkzkzkz....
master vb arek iki
Mantapp sob..
Posting Komentar