C#关键字as出现的错误

       ObjectCache cache = MemoryCache.Default;

            //
string cacheData1 = cache["key1"] as string;//得不到数据
//2
//string cacheData1 = Convert.ToString(cache["key1"]);//这个ok CacheItemPolicy policy1 = new CacheItemPolicy();
policy1.AbsoluteExpiration = new DateTimeOffset(DateTime.Now.AddMinutes());
cache.Set("key1", , policy1); Response.Write($"<h1>{cacheData1}</h1>");
Response.End();
上一篇:python 线程 event


下一篇:CSS两列布局的N种实现