How to prevent control of the client from repeat the login system with the same account.
Solution: Maintain an online table, check with logins, will not log in again, as a sessionID as a unique identifier symbol, can also generate a GUID to cookie, distinguish between different clients, then JS, can achieve better The effect, such as automatically offline the code after departure:
Public Virtual Void Application_Start (Object Sender, Eventargs E) {// Reset The Mailer IndicatorApplication ["Mailerstatus"] = "all mailings completion";
// initialize a datatable for users onlineDataTable objUserTable = new DataTable (); objUserTable.Columns.Add ( "SessionID", System.Type.GetType ( "System.Guid")); objUserTable.Columns.Add ( "PeopleID", System .Type.gettype ("system.int32"))); objusertable.columns.add ("ShowDetail", System.Type.GetType ("System.Boolean")); Datacolumn [] pk = new datacolumn [1]; pk [ 0] = Objusertable.columns [0]; objusertable.primarykey = pk; Application ["useertable"] = objusertable;} ///
/// The session_start event address us /// Application ["useertable"]. ///
public virtual void Session_Start (object sender, EventArgs e) {Application.Lock (); // Application.Lock (); DataTable objUserTable = (DataTable) Application [ "UserTable"]; DataRow objRow = objUserTable.NewRow (); Guid objGuid = Guid.newguid (); objrow [0] = objguid; session ["pfsessionID"] = objrow [0]; objrow [1] = 0; objRow [2] = false; objusertable.Rows.add (objrow); Application ["Utertable"] = objusertable; Application.unlock ();
///
//////// Application ["useertable"]. ////////////