Click here to Skip to main content
15,889,852 members
Home / Discussions / C#
   

C#

 
AnswerRe: What is the best way(s) to send strings from java app to .net app? Pin
Groulien10-May-11 2:35
Groulien10-May-11 2:35 
GeneralRe: What is the best way(s) to send strings from java app to .net app? Pin
CodeGust10-May-11 3:39
CodeGust10-May-11 3:39 
AnswerRe: What is the best way(s) to send strings from java app to .net app? Pin
Wayne Gaylard10-May-11 2:44
professionalWayne Gaylard10-May-11 2:44 
GeneralRe: What is the best way(s) to send strings from java app to .net app? Pin
CodeGust10-May-11 3:41
CodeGust10-May-11 3:41 
AnswerRe: What is the best way(s) to send strings from java app to .net app? Pin
jschell10-May-11 12:14
jschell10-May-11 12:14 
GeneralRe: What is the best way(s) to send strings from java app to .net app? Pin
CodeGust10-May-11 12:31
CodeGust10-May-11 12:31 
GeneralRe: What is the best way(s) to send strings from java app to .net app? Pin
jschell11-May-11 8:04
jschell11-May-11 8:04 
QuestionWinform validation Pin
arkiboys10-May-11 2:10
arkiboys10-May-11 2:10 
Hi,
In c#, I would like to validate the txtEmail by checking if a valid email address has been entered before moving away from the textbox.
If email is not valid then, txtemail should get the focus again.
The code below is what I have for this purpose but whether or not the email is valid the messagebox appears constantly and does not go away.
CAn you please see what is wrong?
Thanks

private static bool IsEmailAllowed(string text)
        {
            bool blnValidEmail = false;
            Regex regEMail = new Regex(@"^[a-zA-Z][\w\.-]{2,28}[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$");
            if (text.Length > 0)
            {
                blnValidEmail = regEMail.IsMatch(text);
            }

            return blnValidEmail;
        }
        
        private void txtEmail_LostFocus(object sender, RoutedEventArgs e)
        {
            if (IsEmailAllowed(txtEmail.Text.Trim()) == false)
            {
                MessageBox.Show("E-Mail expected", "Error", MessageBoxButton.OK, MessageBoxImage.Error);                    
                txtEmail.Focus();
            }
        }

AnswerRe: Winform validation Pin
Rhuros10-May-11 2:50
professionalRhuros10-May-11 2:50 
GeneralRe: Winform validation Pin
arkiboys10-May-11 3:00
arkiboys10-May-11 3:00 
QuestionRe: Winform validation Pin
Pete O'Hanlon10-May-11 3:13
mvePete O'Hanlon10-May-11 3:13 
AnswerRe: Winform validation Pin
arkiboys10-May-11 5:38
arkiboys10-May-11 5:38 
AnswerRe: Winform validation Pin
Shameel10-May-11 2:56
professionalShameel10-May-11 2:56 
GeneralRe: Winform validation Pin
arkiboys10-May-11 3:00
arkiboys10-May-11 3:00 
GeneralRe: Winform validation Pin
Dave Kreskowiak10-May-11 3:45
mveDave Kreskowiak10-May-11 3:45 
GeneralRe: Winform validation Pin
arkiboys10-May-11 5:37
arkiboys10-May-11 5:37 
QuestionHow to cast unknown object? [modified] Pin
Tesic Goran9-May-11 23:59
professionalTesic Goran9-May-11 23:59 
AnswerRe: How to cast unknown object? Pin
Eddy Vluggen10-May-11 0:30
professionalEddy Vluggen10-May-11 0:30 
GeneralRe: How to cast unknown object? Pin
Tesic Goran10-May-11 1:03
professionalTesic Goran10-May-11 1:03 
AnswerRe: How to cast unknown object? Pin
Eddy Vluggen10-May-11 1:25
professionalEddy Vluggen10-May-11 1:25 
GeneralRe: How to cast unknown object? Pin
Tesic Goran10-May-11 1:33
professionalTesic Goran10-May-11 1:33 
AnswerRe: How to cast unknown object? Pin
Eddy Vluggen10-May-11 1:41
professionalEddy Vluggen10-May-11 1:41 
GeneralRe: How to cast unknown object? Pin
Tesic Goran10-May-11 2:19
professionalTesic Goran10-May-11 2:19 
GeneralRe: How to cast unknown object? Pin
Eddy Vluggen10-May-11 2:36
professionalEddy Vluggen10-May-11 2:36 
AnswerRe: How to cast unknown object? Pin
Sanjay J Patolia10-May-11 5:05
Sanjay J Patolia10-May-11 5:05 

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.