session

全局程序文件Global.asax中 
void Session_Start(object sender, EventArgs e) { //页面被访问 只执行一次同 向cookes写入数据 (该cookies有效期在浏览器关闭前) //执行sql语句插入数据. string sql = "update Table_1 set B=B+1 where A=1 "; int a= SqlHelper.ExecuteNonQuery(sql); if (a==1) { Response.Write("测试完成"); }else { Response.Write("测试失败"); } }
原文地址:https://www.cnblogs.com/enych/p/7864832.html