當前位置: 首頁>>代碼示例>>C#>>正文


C# RedisClient.HKeys方法代碼示例

本文整理匯總了C#中ServiceStack.Redis.RedisClient.HKeys方法的典型用法代碼示例。如果您正苦於以下問題:C# RedisClient.HKeys方法的具體用法?C# RedisClient.HKeys怎麽用?C# RedisClient.HKeys使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在ServiceStack.Redis.RedisClient的用法示例。


在下文中一共展示了RedisClient.HKeys方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: ListAll

        public static void ListAll(RedisClient client)
        {
            var keys = client.HKeys(wordHashStructure);
            var stringifiedKeys = new List<string>();
            foreach (var key in keys)
            {
                stringifiedKeys.Add(Extensions.StringFromByteArray(key));
            }

            foreach (var key in stringifiedKeys)
            {
                Console.WriteLine(key + " : " + Extensions.StringFromByteArray(client.HGet(wordHashStructure, key.ToAsciiCharArray())));
            }
        }
開發者ID:PetarPenev,項目名稱:Telerik,代碼行數:14,代碼來源:Program.cs

示例2: ProcessUserCommand

 private static void ProcessUserCommand(RedisClient words)
 {
     string loweredInput = Console.ReadLine().ToLower();
     if (loweredInput == "a")
     {
         Utilities.SreachWord(words);
     }
     else if (loweredInput == "b")
     {
         byte[][] dictionary = words.HKeys("words");
         if (dictionary.GetLength(0) != 0)
         {
             foreach (var wordAsArray in dictionary)
             {
                 string word = Extensions.StringFromByteArray(wordAsArray);
                 Console.WriteLine(word);
             }
         }
         else
         {
             Console.WriteLine("There has no words in dictionary");
         }
     }
     else if (loweredInput == "c")
     {
         Utilities.EditWord(words);
     }
     else if (loweredInput == "d")
     {
         Utilities.RemoveWords(words);
     }
     else if (loweredInput == "e")
     {
         Utilities.AddWord(words);
     }
     else if (loweredInput == "x")
     {
         Environment.Exit(0);
     }
     else
     {
         Console.WriteLine("Wrong command");
     }
 }
開發者ID:Gerya,項目名稱:TelerikAcademy,代碼行數:44,代碼來源:Program.cs


注:本文中的ServiceStack.Redis.RedisClient.HKeys方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。