bouchnina

Verifier Email en c#

May 5th, 2013
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.62 KB | None | 0 0
  1. /*
  2. Notez Bien : tb = TextBox
  3. c est un code pour verifier si l email entré dans un textbox est valid ou non
  4. page : Langage C
  5. Link : https://www.facebook.com/MOBY.c00
  6. */
  7.  
  8. private void button1_Click(object sender, EventArgs e)
  9.         {
  10.             if ((tb.Text.Contains('@') || tb.Text.Contains('.') || tb.Text != "")&&(tb.Text.IndexOf('@') < (tb.Text.IndexOf('.') - 1 )&& tb.Text.IndexOf('@') != 0))
  11.             {
  12.                     MessageBox.Show("Email Valid !", "Good");
  13.             }
  14.             else
  15.             {
  16.                 MessageBox.Show("Email non valid ", "Erreur");
  17.             }
  18.            
  19.         }
Advertisement
Add Comment
Please, Sign In to add comment