07-05-20, 05:39 AM
السلام عليكم ورحمة الله وبركاته
الصورة ارجو ان تكون واضحة فهي كافية ومع ذلك فالكود اسفل هذا الكلام
PHP كود :
Public Class Form1
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
Dim all As String = TextBox1.Text
TextBox1.Clear()
Dim t As String = ""
For Each h As String In all
t &= Convert.ToInt32(Convert.ToChar(h)) & "|"
Next
TextBox1.Text = t
End Sub
Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click
Dim all As String = TextBox1.Text
TextBox1.Clear()
Dim t As String = ""
For Each h As String In all.Split("|")
If Trim(h.Trim).ToString.Trim <> "" Then
Dim c As Char = Convert.ToChar(Convert.ToInt32(h))
t &= c
End If
Next
TextBox1.Text = t
End Sub
End Class
افضل طريقة بالنسبة لي استخدام زر واحد وقيمة منطقية تساعد على اخذ القرار بالتشفير او فكه
وهذا مثال معدل
PHP كود :
Public Class Form1
Dim enced As Boolean
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
Dim all As String = TextBox1.Text
TextBox1.Clear()
If enced = False Then
Dim t As String = ""
For Each h As String In all
t &= Convert.ToInt32(Convert.ToChar(h)) & "|"
Next
TextBox1.Text = t
enced = True
ElseIf enced = True Then
Dim t As String = ""
For Each h As String In all.Split("|")
If Trim(h.Trim).ToString.Trim <> "" Then
Dim c As Char = Convert.ToChar(Convert.ToInt32(h))
t &= c
End If
Next
TextBox1.Text = t
enced = False
End If
End Sub
End Class