您的位置:首页 > 理论基础 > 计算机网络

HttpContext中保存上下文使用的参数

2016-07-27 15:11 507 查看
一个是HttpContext.Current.Timestamp

一个是HttpContext.Current.Items

public class TxnLog
{
const string id_key = "id_key";
public TxnLog()
{
var d = HttpContext.Current.Timestamp.ToString("yyyyMMddHHmmssfffffff");
object s = HttpContext.Current.Items[id_key];
if (s == null)
{
d = d + "_" + helper.idq.CreateToken();
HttpContext.Current.Items[id_key] = d;
}
else
{
d = s.ToString();
}
this.SN = d;
}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  HttpContext