本文整理汇总了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())));
}
}
示例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");
}
}