Saturday, March 27, 2004

Validating Email Addresses

While doing some coding the other day I needed an expression to validate email addresses. The trick was that it had to be flexible enough to handle emails in the format of username@company.com and firstname.lastname@company.com.

 

Imports System.Text.RegularExpressions

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        Dim strEmail As String = "thom.robbins@microsoft.com"

        Dim regexp As New Regex("^([\w-]+\.)*?[\w-]+@[\w-]+\.([\w-]+\.)*?[\w]+$")

 

        If regexp.IsMatch(strEmail) Then

            MsgBox("Valid Email")

        Else

            MsgBox("Invalid Email")

        End If

End Sub


7:31:51 PM    
comment [] trackback []

MSDN Sessions are Coming

Looking for great content? Joe Stagner a good friend and one of my peers here at MS is presenting. Definately worth checking out.

Free Developer Focused Security Seminars

I’ll be delivering the following two security sessions in April in these cities:

  • Augusta, ME (4/6/2004)
  • South Portland, ME (4/8/2004)
  • Lanesborough, MA (4/20/2004)
  • Manchester, NH (4/22/2004)

Session 1: Writing Secure Code – Threat Defense

In this session for experienced developers, you will learn established best practices for applying security principles throughout the development process. You will learn effective strategies for defending common security threats such as buffer overruns, cross-site scripting, SQL injection, and denial of service attacks.

Session 2: Implementing Application Security using the .NET Framework

Building on the previous session, you will learn how to implement additional security features to secure applications that are built on the .NET Framework. We’ll show you how to leverage security features that are integrated into the .NET Framework. You will learn how to use both code access security and role-based security to limit vulnerabilities. You will also learn how to use the cryptographic provider support in the .NET Framework to encrypt and sign data. Additionally, you will learn how to secure Web applications and Web services that are built by using ASP.NET. Finally, you will learn a few tips for writing secure code with the .NET Framework

Coming in May

We will be back in your neck of the woods and looking at the NEXT GENERATION of Developer Technology from Microsoft with seminars in May and June about Whidbey, Yukon, SQL Server Reporting Services and Application Block best practices. Here is the line up:

  • Vernon, CT  (5/4/2004)
  • Boston, MA  (5/6/2004)
  • Trumbull, CT  (5/18/2004)
  • Providence, RI  (5/20/2004)
  • Manchester, NH  (6/10/2004)

Space is limited, register today at www.msdnevents.com!

 

 


11:52:04 AM    
comment [] trackback []