本文介绍了运行SQL查询,当浏览器被关闭的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何运行SQL查询时,浏览器被用户关闭
在asp.net C#?

How can i run sql query when the browser was closed by a userin asp.net c# ?

if (browser was closed){
SqlCommand cmd = new SqlCommand("check_if_closed", con);
                        cmd.CommandType = System.Data.CommandType.StoredProcedure;
                        cmd.Parameters.AddWithValue("@user_id", txtUname.Text);
                        con.Open();
                        cmd.ExecuteNonQuery();
}

感谢。

推荐答案

这就是我一直认为很少为你们写的
但我设法解决这个问题有检查,如果用户的cookie是活着还是不
通过检查它每隔几分钟。

So i have tried few thinks as you guys wrotebut i managed to solved this issue with checking if the users cookie is alive or notby checking it every few minutes.

我还是谢谢你。
希望我给一些想法给他人。

thanks anyway. hoping that i gave some ideas to others.

这篇关于运行SQL查询,当浏览器被关闭的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-21 14:04