• <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>
  • 判斷字符串是否是合法的EMail

    發表于:2007-05-25來源:作者:點擊數: 標簽:Email是否是合法判斷字符串
    Public Function IsValidEmail(strEmail As String) As Boolean Dim names, name, i, c IsValidEmail = True names = Split(strEmail, "@") If UBound(names) 1 Then IsValidEmail = False Exit Function End If For Each name In names If Len(name) = 0 Th

    Public Function IsValidEmail(strEmail As String) As Boolean
      Dim names, name, i, c
      IsValidEmail = True
      
      names = Split(strEmail, "@")

      If UBound(names) <> 1 Then
        IsValidEmail = False
        Exit Function
      End If

      For Each name In names

        If Len(name) <= 0 Then
          IsValidEmail = False
          Exit Function
        End If

        For i = 1 To Len(name)
          c = LCase(Mid(name, i, 1))

          If InStr("abcdefghijklmnopqrstuvwxyz_-.", c) <= 0 And Not IsNumeric(c) Then
            IsValidEmail = False
            Exit Function
          End If
        Next

        If Left(name, 1) = "." Or Right(name, 1) = "." Then
          IsValidEmail = False
          Exit Function
        End If

      Next

      If InStr(names(1), ".") <= 0 Then
        IsValidEmail = False
        Exit Function
      End If

      i = Len(names(1)) - InStrRev(names(1), ".")

      If i <> 2 And i <> 3 Then
        IsValidEmail = False
        Exit Function
      End If

      If InStr(strEmail, "..") > 0 Then
        IsValidEmail = False
        Exit Function
      End If

    End Function

    原文轉自:http://www.kjueaiud.com

    老湿亚洲永久精品ww47香蕉图片_日韩欧美中文字幕北美法律_国产AV永久无码天堂影院_久久婷婷综合色丁香五月

  • <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>