关闭浏览器按钮退出系统问题

    技术2022-07-02  113

    Top.aspx页面:

    <body οnunlοad="LogOut()">

    </body>

     

    <script type="javascript/text" >

    function LogOut() {  var c= Ufida.T.UI._top.RecordLogOut();   }

    </script>

     

    Top.aspx.cs:

     namespace Ufida.T.UI {     public partial class _top : BasePage     {         protected void Page_Load(object sender, EventArgs e)         {             this.CheckLogin();             AjaxPro.Utility.RegisterTypeForAjax(typeof(_top));             this.labUserName.Text = this.userDTO.UserName;             if (Session["usercount"] != null)             {                 this.lblzds.Text = Session["usercount"].ToString();             }             //this.labOrgName.Text = strUserOrgName         }         [AjaxPro.AjaxMethod()]         public string RecordLogOut()         {             //add by yxh 2010-12-02 注销加密站点             UserDTO udto = Session["userdto"] as UserDTO;             bool b = LDHTSCManager.Logout(udto.UserName);             try             {                                 string id = Session["loginid"].ToString();                 string logTime = DateTime.Now.ToString();                 SQLDataModuleService module = new SQLDataModuleService();                 int count = module.ExecuteSql("update LOG_LOGIN set ENDDATE='" + DateTime.Parse(logTime) + "' where ID='" + id + "'");                 Session.Clear();                 return "1";             }             catch (Exception ex)             {                 Session.Clear();                 return "0";             }                     }            } }

     


    最新回复(0)