title: How can User login only with email ending with @uae.com using WPF C#?
body: <p>I have created a login page in my application window, what I need is there any code,  users can only login if their emails end with ......@uae.com, otherwise (messagebox.show(&quot;Sorry, you can't login&quot;)).</p>
  <blockquote>
  <p>Mainwindow.xaml.cs code</p>
  </blockquote>
  <pre><code> private void btn_Login_Click(object sender, RoutedEventArgs e)
          {
              if(btn_Email.Text.Length==0)
              {
                  System.Windows.MessageBox.Show(&quot;Please Enter Your Email!&quot;);
                  btn_Email.Focus();
              }
              else if (!Regex.IsMatch(btn_Email.Text, @&quot;^[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$&quot;))
              {
                  System.Windows.MessageBox.Show(&quot;Please Enter Valid Email!&quot;);
                  btn_Email.Select(0, btn_Email.Text.Length);
                  btn_Email.Focus();
              }
              if (btn_Password.Password == &quot;&quot;)
              {
                  System.Windows.MessageBox.Show(&quot;Please Enter Password!&quot;);
              }
              else if (btn_Password.Password == &quot;maryam&quot;)
              {
                  MainWindow home = new MainWindow();
                  home.Show();
                  this.Close();
              }
              else
                  System.Windows.MessageBox.Show(&quot;Wrong Password!&quot;,&quot;Error!&quot;,MessageBoxButton.OK, (MessageBoxImage)MessageBoxIcon.Error);
          }
  </code></pre>