Click here to Skip to main content
15,888,216 members
Home / Discussions / C#
   

C#

 
GeneralRe: printing problem? Pin
maifs6-May-09 4:50
maifs6-May-09 4:50 
GeneralRe: printing problem? Pin
Henry Minute6-May-09 5:43
Henry Minute6-May-09 5:43 
QuestionCompile/decompile CHM files in C# Pin
marca2926-May-09 1:26
marca2926-May-09 1:26 
AnswerRe: Compile/decompile CHM files in C# Pin
Member 1624358015-Apr-24 0:18
Member 1624358015-Apr-24 0:18 
GeneralRe: Compile/decompile CHM files in C# Pin
trønderen15-Apr-24 3:19
trønderen15-Apr-24 3:19 
QuestionValidate emailaddress Pin
hitesh.kalra5-May-09 23:54
hitesh.kalra5-May-09 23:54 
AnswerRe: Validate emailaddress Pin
Pete O'Hanlon6-May-09 0:02
mvePete O'Hanlon6-May-09 0:02 
AnswerRe: Validate emailaddress Pin
MumbleB6-May-09 0:02
MumbleB6-May-09 0:02 
The best way of doing this is using Regex. Try the below code.
        private void txtboxEmailAdd_Validating(object sender, CancelEventArgs e)
        {
            string pattern = @"^[a-z][a-z|0-9|]*([_][a-z|0-9]+)*
([.][a-z|0-9]+([_][a-z|0-9]+)*)?@[a-z][a-z|0-9|]*\.([a-z][a-z|0-9]*(\.[a-z][a-z|0-9]*)?)$";
            System.Text.RegularExpressions.Match match = 
                Regex.Match(txtboxEmailAdd.Text.Trim(), pattern, RegexOptions.IgnoreCase);
            if (match.Success || txtboxEmailAdd.Text == "")
                return;
            else
                MessageBox.Show("Invalid Email Address" + "\r\n" + "Please enter Valid Email", "Invalid Email Error",MessageBoxButtons.OK, MessageBoxIcon.Error);
            e.Cancel = false;
        }


Excellence is doing ordinary things extraordinarily well.

AnswerRe: Validate emailaddress Pin
OriginalGriff6-May-09 0:05
mveOriginalGriff6-May-09 0:05 
GeneralRe: Validate emailaddress Pin
Pete O'Hanlon6-May-09 0:16
mvePete O'Hanlon6-May-09 0:16 
GeneralRe: Validate emailaddress Pin
OriginalGriff6-May-09 0:31
mveOriginalGriff6-May-09 0:31 
GeneralRe: Validate emailaddress Pin
MumbleB6-May-09 0:57
MumbleB6-May-09 0:57 
GeneralRe: Validate emailaddress Pin
Mycroft Holmes6-May-09 1:15
professionalMycroft Holmes6-May-09 1:15 
GeneralRe: Validate emailaddress Pin
MumbleB6-May-09 2:03
MumbleB6-May-09 2:03 
GeneralRe: Validate emailaddress Pin
Pete O'Hanlon6-May-09 2:32
mvePete O'Hanlon6-May-09 2:32 
QuestionData gridview Pin
hitesh.kalra5-May-09 23:53
hitesh.kalra5-May-09 23:53 
AnswerRe: Data gridview Pin
Vimalsoft(Pty) Ltd6-May-09 0:24
professionalVimalsoft(Pty) Ltd6-May-09 0:24 
GeneralRe: Data gridview Pin
hitesh.kalra6-May-09 0:32
hitesh.kalra6-May-09 0:32 
GeneralRe: Data gridview Pin
Vimalsoft(Pty) Ltd6-May-09 0:58
professionalVimalsoft(Pty) Ltd6-May-09 0:58 
QuestionCrystal report Pin
hitesh.kalra5-May-09 23:45
hitesh.kalra5-May-09 23:45 
AnswerRe: Crystal report Pin
Sun Rays5-May-09 23:53
Sun Rays5-May-09 23:53 
GeneralRe: Crystal report Pin
hitesh.kalra5-May-09 23:56
hitesh.kalra5-May-09 23:56 
GeneralRe: Crystal report Pin
Sun Rays6-May-09 0:01
Sun Rays6-May-09 0:01 
GeneralRe: Crystal report Pin
hitesh.kalra6-May-09 0:03
hitesh.kalra6-May-09 0:03 
GeneralRe: Crystal report Pin
Sun Rays6-May-09 0:28
Sun Rays6-May-09 0:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.