16,006,362 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View .NET questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Rajesh Nagaraj (Top 1 by date)
Rajesh Nagaraj
12-Jun-21 9:18am
View
Can You Please Help Me Where To Put The Above Code To Disable Hot Keys For My C# Form
This Helps Me For My Project.
Please Help Me, I'm A Newbie Here!!
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.OleDb;
namespace login_and_Register_System
{
public partial class frmRegister : Form
{
public frmRegister()
{
InitializeComponent();
}
readonly OleDbConnection con = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=db_users.mdb");
OleDbCommand cmd = new OleDbCommand();
//readonly OleDbDataAdapter da = new OleDbDataAdapter();
private void button1_Click(object sender, EventArgs e)
{
if (txtUsername.Text == "" && txtPassword.Text == "" && txtComPassword.Text == "")
{
MessageBox.Show("Username and Password fields are empty", "Registration Failed", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
else if (txtPassword.Text == txtComPassword.Text)
{
con.Open();
string register = "INSERT INTO tbl_users VALUES ('" + txtUsername.Text + "','" + txtPassword.Text + "')";
cmd = new OleDbCommand(register, con);
cmd.ExecuteNonQuery();
con.Close();
txtUsername.Text = "";
txtPassword.Text = "";
txtComPassword.Text = "";
MessageBox.Show("Your Account has been Successfully Created", "Registration Success", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
else
{
MessageBox.Show("Passwords does not match, Please Re-enter", "Registration Failed", MessageBoxButtons.OK, MessageBoxIcon.Error);
txtPassword.Text = "";
txtComPassword.Text = "";
txtPassword.Focus();
}
}
private void checkbxShowPas_CheckedChanged(object sender, EventArgs e)
{
if (checkbxShowPas.Checked)
{
txtPassword.PasswordChar = '\0';
txtComPassword.PasswordChar = '\0';
}
else
{
txtPassword.PasswordChar = '•';
txtComPassword.PasswordChar = '•';
}
}
private void button2_Click(object sender, EventArgs e)
{
txtUsername.Text = "";
txtPassword.Text = "";
txtComPassword.Text = "";
txtUsername.Focus();
}
private void label6_Click(object sender, EventArgs e)
{
new frmLogin().Show();
this.Hide();
}
private void frmRegister_Load(object sender, EventArgs e)
{
//label2.Text = kryptonDateTimePicker1.Value.ToShortDateString();
}
private void label2_Click(object sender, EventArgs e)
{
}
}
}