我在asp.net页面里
调用System.Web.HttpContext.Current.Application可以得到内容。但是我想在后台服务中取application的值可以嘛?
比如
------------------------------
using System;
using System.Web;class Program
{
static void Main(string[] args)
{
System.Web.HttpContext.Current.Application.Lock();
System.Web.HttpContext.Current.Application["n"] = Convert.ToInt32(System.Web.HttpContext.Current.Application["n"]) + 1;
System.Web.HttpContext.Current.Application.UnLock();
}
}
---------------------------------------------
就不行了,即使 “n”这个服务器变量存在也不能读。有什么办法嘛?
调用System.Web.HttpContext.Current.Application可以得到内容。但是我想在后台服务中取application的值可以嘛?
比如
------------------------------
using System;
using System.Web;class Program
{
static void Main(string[] args)
{
System.Web.HttpContext.Current.Application.Lock();
System.Web.HttpContext.Current.Application["n"] = Convert.ToInt32(System.Web.HttpContext.Current.Application["n"]) + 1;
System.Web.HttpContext.Current.Application.UnLock();
}
}
---------------------------------------------
就不行了,即使 “n”这个服务器变量存在也不能读。有什么办法嘛?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货