Question: How to prevent users from logging in with the same account

xiaoxiao2021-03-06  109

To set the current login user ID to a table of test 2 on the login button, delete it when the user clicks "exit". But if the user does not press "Exit" to close the browser directly, why does SESSION_END do not work? The following is the code in session_end. Thank you. Protected void session_end (Object sender, Eventargs e) {response.write ("


" "session_end" "
"); string strsssion = session ["usid"]. TOSTRING ();

String myconnstring = "provider = microsoft.jet.Oledb.4.0; data source =" server.mappath ("wlhy.mdb"); string strsql = "delete from test 2 where usiD = '" strsssion ""; OLEDBConnection Objconn = new oledbconnection (MyConnString); OLEDBCommand Objcomm = New OLEDBCOMMAND (STRSQL, OBJCONN);

Objconn.open (); Objcomm.executenonQuery (); objconn.close ();

Session.abandon ();

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

New Post(0)