In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly explains the "c # memcached cache to get all the cache keys of the method steps", the article explained the content is simple and clear, easy to learn and understand, now please follow the editor's ideas slowly in depth, together to study and learn "c # memcached cache access to all cache keys method steps" bar!
Working with components
Memcached 1.2.6
.net class library memcacheddotnet_clientlib-1.1.5
1. Add memcacheddotnet_clientlib-1.1.5 code
After downloading the component, open the .net class library memcacheddotnet_clientlib-1.1.5 with vs, open MemCachedClient.cs, and add the following methods:
The copy code is as follows:
Public Hashtable Stats (ArrayList servers, string command)
{
/ / get SockIOPool instance
SockIOPool pool = SockIOPool.GetInstance (_ poolName)
/ / return false if unable to get SockIO obj
If (pool = = null)
{
/ / if (log.IsErrorEnabled)
/ / {
/ / log.Error (GetLocalizedString ("unable to get socket pool"))
/ /}
Return null
}
/ / get all servers and iterate over them
If (servers = = null)
Servers = pool.Servers
/ / if no servers, then return early
If (servers = = null | | servers.Count 1)
{
Int itemID = 0
If (tmpArr [1] = = "_") continue
Int.TryParse (tmpArr [1], out itemID)
If (itemID 1)
{
If (tmpArr [1] = = "_ _")
{
Continue
}
Keys.Add (tmpArr [0])
}
}
}
Return keys
}
Call method
The copy code is as follows:
IList list = MemcachedManager.GetAllKeys ()
Foreach (var item in list)
{
Response.Write (item + "")
}
Thank you for reading, the above is the content of "the method and steps of getting all cache keys by c # memcached cache". After the study of this article, I believe you have a deeper understanding of the method and steps of getting all cache keys by c # memcached cache, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.