如何在Console应用程序中使用c#创建缓存以查询结果 [英] How to create cache to query results using c# in Console application

查看:130
本文介绍了如何在Console应用程序中使用c#创建缓存以查询结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述









我在网络应用程序中创建了缓存,但我需要使用它来创建它c#在控制台应用程序中







这是我在asp .net中的代码





Hi,



I created cache in web application but i need to create it using c# in console application



here is my code in asp .net


Cache[TextBox1.Text] = Jobs;
             Cache.Insert(TextBox1.Text, Jobs);

            
             Cache.Insert(TextBox1.Text,Jobs, null, DateTime.Now.AddMinutes(10), Cache.NoSlidingExpiration);
             string strCache = "";
             string strKey;
             foreach (DictionaryEntry objItem in Cache)
             {
                 strKey = objItem.Key.ToString();
                 strCache = strKey + " : " + DateTime.Now.ToString() + "Cache Expires at" + ":" + DateTime.Now.AddMinutes(10);



$ / b $ b



如何在控制台应用程序中编写





how to write it in console application

推荐答案

这篇关于如何在Console应用程序中使用c#创建缓存以查询结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆