比如我有4个Session ID,Name,Time,Countvoid Session_End(object sender, EventArgs e)
{
//在这里可以运行也可以取到我的Session的值,但怎么取得当前是哪一个Session过期了呢
log("Session:" + ??? + "在" + DateTime.Now.ToString() + "过期");
//问我的???如何来取得当前过期的Session呢
}
//下面是写入log.txt文件的方法
protected void Log(string content)
{
byte[] log = System.Text.Encoding.UTF8.GetBytes(content);
FileStream stream = File.Open(@"E:\Web\log.txt", System.IO.FileMode.OpenOrCreate);
stream.Seek(0, System.IO.SeekOrigin.End);
stream.Write(log, 0, log.Length);
stream.Close();
} 结果例为:
Session:ID在2007-01-03 11:08:41过期
Session:Time在2007-01-03 11:09:11过期
Session:Count在2007-01-03 11:11:20过期
Session:Name在2007-01-03 11:13:03过期谢谢
{
//在这里可以运行也可以取到我的Session的值,但怎么取得当前是哪一个Session过期了呢
log("Session:" + ??? + "在" + DateTime.Now.ToString() + "过期");
//问我的???如何来取得当前过期的Session呢
}
//下面是写入log.txt文件的方法
protected void Log(string content)
{
byte[] log = System.Text.Encoding.UTF8.GetBytes(content);
FileStream stream = File.Open(@"E:\Web\log.txt", System.IO.FileMode.OpenOrCreate);
stream.Seek(0, System.IO.SeekOrigin.End);
stream.Write(log, 0, log.Length);
stream.Close();
} 结果例为:
Session:ID在2007-01-03 11:08:41过期
Session:Time在2007-01-03 11:09:11过期
Session:Count在2007-01-03 11:11:20过期
Session:Name在2007-01-03 11:13:03过期谢谢
给Session一个过期的时间表识
-----------------------------------
是不是比如我的
Session["ID"]过期的时候
这个时候其他的Session都会过期谢谢如果是这样的话那就好办了谢谢