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.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介绍及其用法示例代码
- HttpContext.Current.User.Identity.Name获得不了登录名
- HttpContext
- HttpContext在一般程序中无法快速导入命名空间,报错,无法使用
- [通过HttpWebRequest请求https接口]
- 通过HttpUrlConnection读取数据进行Pull解析
- SSL
- Node.js函数传递之基础HTTP请求
- iOS http请求记录一下
- AFHTTPRequestOperationManager 请求后台获得不到参数解决方法
- k-means和bp神经网络要点总结
- servlet错误:HTTP Status 405 - HTTP method GET is not supported by this URL
- Netperf - The fastest TCP connection with Multipath TCP
- android之ConnectivityManager简介,网络连接状态
- Volley框架实现Android网络请求笔记
- 转发别处的博客关于TCP/IP协议的拥塞控制机制,讲的很好分享下
- HTTP和HTTPS的概念和区别
- 【下载https协议需要的cer证书】
- HTTP_CLIENT_IP、HTTP_X_FORWARDED_FOR、REMOTE_ADDR
- Netperf - 网络性能测量工具