dim a,b
a=split(yourstring,"@")
if ubound(a)<>1 then'非法
b=split(a(1),".")
if ubound(b)<1 then'非法
保证形式是???@???.???

解决方案 »

  1.   

    用Instr判断是否有@符号和.符号及其位置
      

  2.   

    用正则表达试很方便
    匹配邮件地址的模式串是:
    "^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$"
      

  3.   

    Private Sub Form_Load()  MsgBox IsGoodEmail("[email protected]")End Sub
    Private Function IsGoodEmail(ByVal sEmail As String) As Boolean    Dim i As Integer
        Dim j As Integer
        Dim t As Integer
        
        IsGoodEmail = False
        
        sEmail = Trim(sEmail)
        
        j = Len(sEmail)
        If j < 5 Then Exit Function
        
        i = InStr(sEmail, "@")
        If i = 0 Or i > j - 3 Then Exit Function
        t = InStrRev(sEmail, "@")
        If t <> i Then Exit Function
        
        t = InStrRev(sEmail, ".")
        If t = 0 Or t < i Or t = j Then Exit Function
        
        
        IsGoodEmail = TrueEnd Function