السلام عليكم
هذا الموضوع استكمال لدورة الاكواد الشاملة
'12-التأكد من خلو اداة التيكست من الرموز
كود PHP:
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim i As Integer
Dim username As String = TextBox1.Text
Dim strName, strPass As String
For i = 1 To Len(username)
strName = Mid(username, i, 1)
If (Asc(strName) >= 33 And Asc(strName) _
<= 47) Then
MsgBox("النص يحتوي على رموز")
Exit Sub
ElseIf (Asc(strName) >= 58 And Asc(strName) _
<= 64) Then
MsgBox("النص يحتوي على رموز")
Exit Sub
ElseIf (Asc(strName) >= 91 And Asc(strName) _
<= 96) Then
MsgBox("النص يحتوي على رموز")
Exit Sub
ElseIf (Asc(strName) >= 123 And Asc(strName) _
<= 127) Then
MsgBox("النص يحتوي على رموز")
Exit Sub
ElseIf (Asc(strName) >= 238 And Asc(strName) _
<= 247) Then
MsgBox("النص يحتوي على رموز")
Exit Sub
End If
Next
End Sub
End Class
'12-التأكد من خلو اداة التيكست من الرموز
'13- التحكم بلغة ادخال التيكست
كود PHP:
Public Class Form1
Private Declare Function ActivateKeyboardLayout Lib "user32" _
(ByVal HKL As Integer, ByVal Flags As Integer) As Integer
Private Declare Function GetKeyboardLayout Lib "user32" _
(ByVal dwLayout As Integer) As Integer
Public Sub ArabicKeyboard(ByRef language As String)
Dim D As Object
Dim dd As Object
Try
Select Case LCase(language)
Case "a"
dd = GetKeyboardLayout(0)
If dd = 67699721 Then D = _
ActivateKeyboardLayout(1, 0)
Case "e"
dd = GetKeyboardLayout(0)
If dd <> 67699721 Then D = _
ActivateKeyboardLayout(0, 0)
End Select
Catch
End Try
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
ArabicKeyboard("a")
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
ArabicKeyboard("e")
End Sub
End Class
'13- التحكم بلغة ادخال التيكست