Oleh: antonie | Mei 20, 2008

Validate Email using VB.NET

saya memiliki sebuah fungsi validasi email yang tidak memanfaatkan Regular Expression, tapi memanfaatkan System.Net.Mail , sebuah cara yang “tidak biasa”:

Function Detect_MailAddress_Errors(ByVal sMailAdd As String) As Boolean

Try

Dim oMailMsg As New MailMessage

oMailMsg.To.Add(sMailAdd)

Return True

‘Format Exceptions

Catch exFormat As FormatException

‘MsgBox(“Format Error”)

Return False

‘ General Exceptions

Catch ex As Exception

End Try

End Function


Tanggapan

  1. Wah gak bisa pake soal ini lagi dech, lha udah dikasih bocoran hehehehe

  2. @willy: waa, sori2 wil, aku ga tau… tapi kan kalo pake regex bisa lebih susah lagi…


Beri tanggapan

Your response:

Kategori