Email Validation Code
private void button1_Click(object sender, EventArgs e)
{
String ID = txtID.Text;
if ((ID.Count(char.IsDigit) == 9) && (ID.EndsWith("X") || ID.EndsWith("V")) && (ID[2] != '4' && ID[2] != '9'))
{
MessageBox.Show("Valid ID");
}
else
{
MessageBox.Show("Invalid ID");
}
}
NIC Validation Code
private void button1_Click(object sender, EventArgs e)
{
string pattern = null;pattern = "^([0-9a-zA-Z]([-\\.\\w]*[0-9a-zA-Z])*@([0-9a-zA-Z][-\\w]*[0-9a-zA-Z]\\.)+[a-zA-Z]{2,9})$";
if (Regex.IsMatch(txtEmail.Text, pattern))
{
MessageBox.Show("Valid Email address ");
}
else
{
MessageBox.Show("Not a valid Email address ");
}
}
Enjoy learning new things and you want to get as good a grip as possible on how things work and best ways to use information technology. Visit my other blogs here:: http://thissasinfobahn.blogspot.com/:: http://thissann.blogspot.com/:: http://thissanetworkz.blogspot.com/
Sunday, November 15, 2015
Sunday, November 1, 2015
Sunday, October 18, 2015
Creating Database Driven Login Form Using C# & MySQL
Codes
namespace MyProject
{
public partial class frmMyLogin : Form
{
public frmMyLogin()
{
InitializeComponent();
}
MySqlConnection con = new MySqlConnection(@"server=localhost;user id=root;database=employee");
MySqlDataAdapter da = new MySqlDataAdapter();
MySqlCommand cmd = new MySqlCommand();
private void btnLogin_Click(object sender, EventArgs e)
{
con.Open();
string Username = txtUsername.Text;
string Password = txtPassword.Text;
MySqlCommand cmd = new MySqlCommand("Select UserName,Password from login where UserName='"+txtUsername.Text+"'and Password='"+txtPassword.Text+"'",con);
MySqlDataAdapter da = new MySqlDataAdapter(cmd);
DataTable dt = new DataTable();
da.Fill(dt);
if (dt.Rows.Count > 0)
{
MessageBox.Show("Login Sucessfull");
frmMain mymain = new frmMain();
mymain.Show();
this.Hide();
}
else
{
MessageBox.Show("Invalid UserName or Password");
}
con.Close();
}
private void btnCancel_Click(object sender, EventArgs e)
{
DialogResult s = MessageBox.Show("Are you sure do you want to exit", "Exit", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (s == DialogResult.Yes)
{
Application.Exit();
}
}
private void btnNewUser_Click(object sender, EventArgs e)
{
string cmdText = "INSERT INTO login(UserName,Password) VALUES (@UserName, @Password)";
con.Open();
MySqlCommand cmd = new MySqlCommand(cmdText, con);
cmd.Parameters.AddWithValue("@UserName", txtUsername.Text);
cmd.Parameters.AddWithValue("@Password", txtPassword.Text);
cmd.ExecuteNonQuery();
MessageBox.Show("Create new user is successful");
con.Close();
}
}
}
------------
By Thissa
----------------
Sunday, July 26, 2015
M# - The .NET Language

M# ("M sharp") is an implementation of the M programming language based on Microsoft's Dynamic Language Runtime (DLR). Other M implementations
include Matlab, Octave and
SciLab. Extreme Numerical
Optimization .NET libraries
used as underlying
computational kernel.
Because M # is a .NET language, the direct use of the extensive collection of species and libraries can make available for the .NET framework. In particular, in contrast to other implementations of the M language, M # can advanced numerical types such as arbitrary precision integers, using rational numbers and floating-point numbers.
Because M # is a .NET language, the direct use of the extensive collection of species and libraries can make available for the .NET framework. In particular, in contrast to other implementations of the M language, M # can advanced numerical types such as arbitrary precision integers, using rational numbers and floating-point numbers.
Performance
M # uses the same technology as Microsoft two dynamic language Iron Python and Iron Ruby, to measure the best balance of flexibility and speed. The numerical horsepower provided by the Extreme Optimization Numerical Libraries for .NET. This M # can compete around the fastest implementations and significantly outperforms open source implementations.
Official Web site:- msharp.co.ukM # uses the same technology as Microsoft two dynamic language Iron Python and Iron Ruby, to measure the best balance of flexibility and speed. The numerical horsepower provided by the Extreme Optimization Numerical Libraries for .NET. This M # can compete around the fastest implementations and significantly outperforms open source implementations.
References
Monday, July 20, 2015
Web application framework (WAF)
A web application framework (WAF) is a software
framework that is designed to support the development of dynamic websites, web
applications, web services and web resources. The framework is intended to
alleviate the overhead associated with common activities carried out in web
development. For example, many libraries provide frameworks to access the database,
templating frameworks and session management, and they often promote code reuse.
Types of framework architectures
Model–view–controller (MVC)
Many frames will follow the MVC architectural
pattern to separate the data model with business rules from the user interface.
This is generally considered good practice modularizes code promotes code reuse
and multiple interfaces can be used. In Web applications, this makes presented
different views, such as web pages for humans, and web service interfaces for
external applications.
Push-based vs. pull-based
Most MVC
frameworks follows a push -based architecture also called " action -based
" . These frameworks use actions do the required processing , and then
"push" the data to the display layer to the results. Django Ruby on
Rails, Symfony , Spring MVC, Stripes , CodeIgniter are good examples of this
architecture An alternative is pull - based architecture , sometimes called
" component-based " these cadres layers begin with vision, who can
then " pull "the results of multiple controllers as needed In this
architecture , multiple controllers can be involved in one view Elevator ,
Tapestry , JBoss Seam, Java Server Faces ( μ ) Micro and Wicket are examples of
pull - . based architectures Play . Struts, RIFE and ZK have support for both
push and pull -based application controller calls.
Three-tier organization
In three -tier organization, applications are
structured around three physical layers. Client application and database The
database is normally a RDBMS. The application contains the business logic that
runs on a server and communicates with the client using HTTP. [11] The client
web applications is a Web browser that supports HTML is generated by the
application layer. The term should not be confused with MVC , which , unlike
the three - tier architecture , it is regarded as a good practice to keep
business logic of the controller , the " middle layer " .
Books
By Michael NashWednesday, July 15, 2015
Wednesday, July 1, 2015
Haml (HTML Abstraction Markup Language)
Haml (HTML Abstraction Markup Language) is a lightweight markup language used to the XHTML or any web document is to describe without the use of conventional inline coding. It was designed to be a lot of shortcomings in the traditional templating engines and markings make as elegant as it may be to address.
Haml functions as a replacement for the inline page templating systems PHP, ASP and RHTML. However Avoids Haml the need explicitly coding XHTML into the template, because they with some code to generate even a description of the XHTML, dynamic content. Haml’s equivalent for CSS Sass.
Haml official site:-http://haml.info
Subscribe to:
Posts (Atom)
-
මිනිසා කාර්යබහුල වීමත් සමගම තම කටයුතු පහසුවෙන් , වේගයෙන් කාර්යක්ශමව සිදුකරගැනීම සදහා විදුලි බලයෙන් ක්රියාකරනු ලබන විවිධාකාර උපකරණ භාවිත...
-
අංකිත බෙදීම( Digital Divide) තොරතුරු හා සන්නිවේදන තාක්ෂණය මිනිසුන් අතර ප්රචලිත වූවාසේම එම තාක්ෂණය ලොව සැමටම එකම ආකාරයකට බුක්තිවිදිය නොහැක...



