h1.post-title { color:orange; font-family:verdana,Arial; font-weight:bold; padding-bottom:5px; text-shadow:#64665b 0px 1px 1px; font-size:32px; } -->

Pages

Check Password in Vb.net

Today,we will discuss about the Password Checking using regular Expression in VB.net
Here is a Sample code for Password Checking using Regular Expression in VB.Net


Dim reg As Regex
 reg = New Regex("^(?=.*d)(?=.*[a-z])(?=.*[A-Z]).{6,10}$")
     Dim mat As Match = reg.Match(TextBox1.Text)
     If mat.Success = False Then
         MessageBox.Show("Please enter at least one upper case letter, one lower case letter, and one numeric digit.")
         TextBox1.Text = ""
     End If

Use Ternary Operator in Business Layer in C#.Net

      Today we will discuss about the Ternary Operator in Business Layer in C#.Net.
Example for Ternary Operator :
Create a One Class for Business Layer called BLEmp.cs
Copy and paste in the BLEmp.cs File

Private static string _EmpName;
        public static string EmpName
        {
            get { return _EmpName == string.Empty ? "please Enter Name" : _EmpName; }
            set
            { _EmpName = value;   }
        }
 
Drag and Drop TextBox and Button on the form.
Copy and Paste this code in the Button Click Event
 
BLEmp.EmpName = textBox1.Text;
MessageBox.Show(BLEmp.EmpName);