QuicklyBuildModellogin.aspx.cs [fast class built model login page code]

zhaozj2021-02-16  50

using System; using System.Collections; using System.ComponentModel; using System.Data; using System.Drawing; using System.Web; using System.Web.SessionState; using System.Web.UI; using System.Web.UI.WebControls Using system.Web.ui.htmlcontrols;

Namespace Objlogin.quicklyBuildModel {///

/// LogINQUICKLYMODEL's summary description. (Last updated Preprints 6.28) /// public class LoginQuicklyModel: System.Web.UI.Page {protected System.Web.UI.WebControls.Label Label1; protected System.Web.UI.WebControls.Label Label2; protected System.Web.UI.WebControls.TextBox tbUserName; protected System.Web.UI.WebControls.TextBox tbPassword; protected System.Web.UI.WebControls.Button btnLogin; protected System.Web.UI.WebControls.RequiredFieldValidator ValidatorToPassword; protected System. Web.ui.WebControls.RequidFieldValidator ValidatorTouserName; /// /// User object /// private user; private void page_load (Object sender, system.eventargs e) {// Place here User code to initialize page}

#Region Web Form Designer Generated Code Override Protected Void OnNit (Eventargs E) {// // Codegen: This call is required for the ASP.NET Web Form Designer. // InitializeComponent (); base.onit (e);} ///

/// Designer Supports the required method - Do not use the code editor to modify the // / this method. /// private () {this.btnlogin.click = new system.eventhandler (this.btnlogin_click; this.load = new system.eventhandler (this.page_load);

} #Endregion

Private void btnlogin_click (object sender, system.eventargs e) {this.user = new user (this.tbusername.text); if (this.user.checkloginok (true) // if (this. User.checkloginok (false) {

WriteToseession (); // Apply this.user.initsession (); implement response.redirect ("detail.aspx");} else showloginfailMessage ();} ///

/// Write user information Session /// private void writetosesis () {session ["username"] = this.user.username; session ["userrank"] = 1;}

///

/// Display login failed information /// private void showloginfailMessage () {response.write (this.user.getcheckloginfailMessage ());}}}

转载请注明原文地址:https://www.9cbs.com/read-19358.html

New Post(0)