musti 9688
Map Explorer
2
MONTHS
2 2 MONTHS OF SERVICE
LEVEL 1
200 XP
Hi! this is donbermoy again! :) For now i will teach you how to code for the validation of email address when you input it. Email address has two parts namely the local part of the address which is the part before the @ sign, and the domain name in which the email message will be sent.
So, now let's start this tutorial!
1. Let's start with creating a Windows Form Application for this tutorial by following the following steps in Microsoft Visual Studio: Go to File, click New Project, and choose Windows Application.
2. Next, add a TextBox named TextBox1 for the inputting of an e-mail address and one Button named Button1 that will decide if the email is valid or not. You must design your layout like this:
3. Now, put this code in Button1_Click. This will display the result of the valid or invalid email address you've entered in the TextBox.
Explanation:
We have imported System.
Text
.
RegularExpressions
because we will use regular expression function to commnunicate with our input. We also initialized expression As String to hold the string value of "^([0-9a-zA-Z]([-\.\w]*[0-9a-zA-Z])*@([0-9a-zA-Z][-\w]*[0-9a-zA-Z]\.)+[a-zA-Z]{2,9})$". VB.NET provides an extensive set of regular expression tools that enable to efficiently compare strings as well as rapidly parse large amounts of text and data to search for, remove, and replace text patterns for validating an email address. Regex.
IsMatch
(
TextBox1.
Text
, expression)
- this syntax indicates whether the specified regular expression finds a match in the specified input string of our textbox and compare its regural expression to our variable expression. If the comparing was right, then it will display, "Valid Email address ". Otherwise, it will prompt the user "Not a valid Email address ".
Output:
Download the source code below and try it! :)
For more inquiries and need programmer for your thesis systems in any kind of programming languages, just contact my number below.
Best Regards,
Engr. Lyndon R. Bermoy
IT Instructor/System Developer/Android Developer
Mobile: 09079373999
Telephone: 826-9296
E-mail:[email protected]
Visit and like my page on Facebook at: Bermz ISware Solutions
Subscribe at my YouTube Channel at: SerBermz
Download
So, now let's start this tutorial!
1. Let's start with creating a Windows Form Application for this tutorial by following the following steps in Microsoft Visual Studio: Go to File, click New Project, and choose Windows Application.
2. Next, add a TextBox named TextBox1 for the inputting of an e-mail address and one Button named Button1 that will decide if the email is valid or not. You must design your layout like this:

3. Now, put this code in Button1_Click. This will display the result of the valid or invalid email address you've entered in the TextBox.
- Imports
System.
Text
.
RegularExpressions
- Public
Class
Form1
- Private
Sub
Button1_Click(
ByVal
sender As
System.
Object
, ByVal
e As
System.
EventArgs
)
Handles
Button1.
Click
- Dim
expression As
String
- expression =
"^([0-9a-zA-Z]([-\.\w]*[0-9a-zA-Z])*@([0-9a-zA-Z][-\w]*[0-9a-zA-Z]\.)+[a-zA-Z]{2,9})$"
- If
Regex.
IsMatch
(
TextBox1.
Text
, expression)
Then
- MsgBox
(
"Valid Email address "
)
- Else
- MsgBox
(
"Not a valid Email address "
)
- End
If
- End
Sub
- End
Class
Explanation:
We have imported System.
Text
.
RegularExpressions
because we will use regular expression function to commnunicate with our input. We also initialized expression As String to hold the string value of "^([0-9a-zA-Z]([-\.\w]*[0-9a-zA-Z])*@([0-9a-zA-Z][-\w]*[0-9a-zA-Z]\.)+[a-zA-Z]{2,9})$". VB.NET provides an extensive set of regular expression tools that enable to efficiently compare strings as well as rapidly parse large amounts of text and data to search for, remove, and replace text patterns for validating an email address. Regex.
IsMatch
(
TextBox1.
Text
, expression)
- this syntax indicates whether the specified regular expression finds a match in the specified input string of our textbox and compare its regural expression to our variable expression. If the comparing was right, then it will display, "Valid Email address ". Otherwise, it will prompt the user "Not a valid Email address ".
Output:


Download the source code below and try it! :)
For more inquiries and need programmer for your thesis systems in any kind of programming languages, just contact my number below.
Best Regards,
Engr. Lyndon R. Bermoy
IT Instructor/System Developer/Android Developer
Mobile: 09079373999
Telephone: 826-9296
E-mail:[email protected]
Visit and like my page on Facebook at: Bermz ISware Solutions
Subscribe at my YouTube Channel at: SerBermz
Download
You must upgrade your account or reply in the thread to view the hidden content.