此允许的字符检查如何工作?

时间:2019-02-18 22:10:38

标签: vb.net

不了解这段代码的作用

Dim strAllowedChars As String = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz() -+ "

If Len(TxtFirstName.Text) = 0 Then
    Exit Sub
Else
    For i = 0 To Len(TxtFirstName.Text) - 1
        If InStr(1, strAllowedChars, TxtFirstName.Text(i)) = 0 Then
            MsgBox("Number Detected")
            TxtFirstName.Focus()
            Exit Sub
        End If
    Next
End If

不了解代码的实际作用

0 个答案:

没有答案