代码
System.Web.Caching.Cache c = System.Web.HttpRuntime.Cache;
if (c != null)
...{
c.Insert(
"1", "123141432432");
object o = c.Get("1");
Console.WriteLine(o);
}
时候项目里需要用窗体应用程序做一些小工具,碰到了需要缓存的问题。以上是解决办法,要追加System.Web的引用。尽管在Web命名空间里,非Web程序也可以使用。

 

相关文章:

  • 2021-05-15
  • 2021-07-01
  • 2021-05-29
  • 2021-06-28
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-01-18
  • 2021-07-29
  • 2022-12-23
  • 2021-11-20
  • 2022-12-23
  • 2021-10-29
  • 2021-09-26
相关资源
相似解决方案