In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article introduces the relevant knowledge of "how to realize the administrator login design". In the operation of the actual case, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
Learning task 1 to understand the definition of namespaces
Define
Namespace space name
{
Class
}
Quote
Using space name
Learning task 2 to realize the design of administrator login interface
The layout of the interface is shown in the figure:
Tip: when inserting a table, you should pay attention to the size, layout, border, background settings of the table, ready in advance, you can save the next work; the second point is to distinguish between image and imagebutton.
Learning task 3 to realize the verification of login interface
Step 1: use the third-party control CAPTCHA control to download the .dll file and add it to the toolbox.
Step 2: in the solution Explorer panel of Visual Studio 2008, right-click the site and select add ASP.NET folder to the Bin command from the pop-up shortcut menu. Right-click "Bin folder" in the pop-up dialog box, select "add reference" command in the pop-up shortcut menu, select "Browse" tab in the pop-up "add reference" dialog box, locate the WebValidates.dll file and add it to the Bin folder.
Step 3: drag and drop controls to the page.
Step 4: write code to load and generate CAPTCHA for the first time. The code is as follows:
Public partial class _ Default: System.Web.UI.Page {protected void Page_Load (object sender, EventArgs e) {if (! IsPostBack) {SnCode.Create ();}}
Step 5: double-click the Login button to add the following code to the adminlogin.aspx.cs code page:
Public partial class admin_adminlogin: System.Web.UI.Page {protected void Page_Load (object sender, EventArgs e) {if (! IsPostBack) {SnCode.Create ();}} protected void ImageButton6_Click (object sender, ImageClickEventArgs e) {if (SnCode.CheckSN (TextBox3.Text.Trim)) {String username = TextBox1.Text; String userpwd = TextBox2.Text; users user1 = null; user1 = new users () User1.Admin = username; user1.Pwd = userpwd; DataSet ds1 = new userschuli (). Adminlogin (user1); DataTable dt = ds1.Tables [0]; if (dt.Rows.Count > 0) {Response.Write ("alert ('username and password is correct!');} else {Response.Write (" alert ('username or password is incorrect!'); ") }} else {Response.Write ("alert ('CAPTCHA error!');");}} protected void ImageButton5_Click (object sender, ImageClickEventArgs e) {TextBox1.Text = "; TextBox2.Text ="; TextBox3.Text =";}}
Step 6: run the debugging code, when the user name and password are correct and the verification code is correct, the login success prompt box pops up, otherwise the username or password error prompt box pops up.
Run the effect diagram:
This is the end of the content of "how to implement the administrator login design". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.