Application对象读取类AppService.cs
using System.Web;
namespace TestWebServices
{
public class AppService
{
public void SetAppState(string key,string value)
{
HttpApplicationState Application = HttpContext.Current.Application;
Application.Lock();
Application[key] = value;
Application.UnLock();
}
public string GetAppState(string key)
{
HttpApplicationState Application = HttpContext.Current.Application;
if (Application[key] == null)
{
return null;
}
else if (Application[key] is System.String)
{
return Application[key].ToString();
}
else
{
return null;
}
}
}
}
namespace TestWebServices
{
public class AppService
{
public void SetAppState(string key,string value)
{
HttpApplicationState Application = HttpContext.Current.Application;
Application.Lock();
Application[key] = value;
Application.UnLock();
}
public string GetAppState(string key)
{
HttpApplicationState Application = HttpContext.Current.Application;
if (Application[key] == null)
{
return null;
}
else if (Application[key] is System.String)
{
return Application[key].ToString();
}
else
{
return null;
}
}
}
}
本贴子以“现状”提供且没有任何担保,同时也没有授予任何权利
This posting is provided "AS IS" with no warranties, and confers no rights.
This posting is provided "AS IS" with no warranties, and confers no rights.
浙公网安备 33010602011771号