"景先生毕设|www.jxszl.com

C# Cache类代码示例

2023-12-29 17:37编辑: www.jxszl.com景先生毕设
本文整理汇总了C#中Cache类的典型用法代码示例。如果您正苦于以下问题:C#Cache类的具体用法?C#Cache怎么用?C#Cache使用的例子?这里精选的类代码示例或许可以为您提供帮助。 示例1:Main staticvoidMain(string[]args) { varcouchbaseConfig=newCouchbase.Configuration.CouchbaseClientConfiguration(); couchbaseConfig.Bucket="larm"; couchbaseConfig.Urls.Add(newUri("http://10.0.252.63:8091/pools")); varcache=newCache(newCouchbase.CouchbaseClient(couchbaseConfig)); varportalRepository=newPortalRepository().WithConfiguration("userid=larm-app;password=0n44Fx4f4m2jNtuLuA6ym88mr3h40D;server=mysql01.cpwvkgghf9fg.eu-west-1.rds.amazonaws.com;persistsecurityinfo=True;database=larm-portal;AllowUserVariables=True;CharSet=utf8;"); varportal=newPortalApplication(cache,newViewManager(newDictionary(),cache),portalRepository,newDatabaseLoggerFactory(portalRepository)); varmcm=newMcmModule(); mcm.Load(portal); constuintPageSize=100; varindexedCount=0; for(uinti=0;;i++) { varobjects=mcm.McmRepository.ObjectGet(null,i,PageSize,true,true,true,true,true,null); portal.ViewManager.GetView("Search").Index(objects); portal.ViewManager.GetView("Object").Index(objects); Console.SetCursorPosition(0,Console.CursorTop); Console.Write("Objectsindexed:{0}",++indexedCount); if(objects.Count!=PageSize)break; } }
原文链接:http://www.jxszl.com/biancheng/C/556636.html