使用組件
memcached 1.2.6
.net 類庫 memcacheddotnet_clientlib-1.1.5
1.增加memcacheddotnet_clientlib-1.1.5代碼
下載好組件后,用vs打開.net類庫memcacheddotnet_clientlib-1.1.5,打開MemCachedClient.cs,增加如下方法:
代碼如下:
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 <= 0)
{
//if(log.IsErrorEnabled)
//{
// log.Error(GetLocalizedString("stats no servers"));
//}
return null;
}
// array of stats Hashtables
新聞熱點
疑難解答
圖片精選