Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Data
Imports System.Drawing
Imports System.Text
Imports System.Windows.Forms
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Try
textBox2.Clear()
textBox1.Text = textBox1.Text.Replace(" ", "")
textBox1.Text = textBox1.Text.Replace(vbLf & vbTab, "")
textBox1.Text = textBox1.Text.Trim()
Dim StrLen As Integer = textBox1.Text.Length
Dim a As Integer = 0
While a < StrLen
Dim Char2Convert As String = textBox1.Text.Substring(a, 2)
Dim n As Integer = Convert.ToInt32(Char2Convert, 16)
Dim c As Char = ChrW(n)
textBox2.Text = textBox2.Text + c.ToString()
a = a + 2
End While
Catch ex As Exception
MessageBox.Show("Conversion Error Occured : " & ex.Message, "Conversion Error")
End Try
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Try
textBox1.Clear()
textBox2.Text = textBox2.Text.Replace(" ", "")
textBox2.Text = textBox2.Text.Replace(vbLf & vbTab, "")
textBox2.Text = textBox2.Text.Trim()
Dim StrLen As Integer = textBox2.Text.Length
Dim a As Integer = 0
While a < StrLen
Dim Char2Convert As String = textBox2.Text.Substring(a, 1)
Dim c As Char = Char2Convert.ToCharArray(0, 1)(0)
Dim n As String = Convert.ToString(c, 16)
textBox1.Text = textBox1.Text + n & " "
a = a + 1
End While
Catch ex As Exception
MessageBox.Show("Conversion Error Occured : " & ex.Message, "Conversion Error")
End Try
End Sub
End Class
|