本文整理汇总了C#中ServiceStack.Redis.RedisClient.HGetAll方法的典型用法代码示例。如果您正苦于以下问题:C# RedisClient.HGetAll方法的具体用法?C# RedisClient.HGetAll怎么用?C# RedisClient.HGetAll使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ServiceStack.Redis.RedisClient
的用法示例。
在下文中一共展示了RedisClient.HGetAll方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PrintAllWords
private static void PrintAllWords(RedisClient client)
{
var words = client.HGetAll("dictionary"); // returns byte[][], where first dimension is [key],[value],..,[key],[value]
Console.WriteLine("All words in dictionary:");
for (int i = 0; i < words.GetLength(0); i+=2)
{
Console.WriteLine("{0} -> {1}",
IntoString(words[i]), IntoString(words[i+1]));
}
}
示例2: ListAllEntries
public static void ListAllEntries(RedisClient redisIO)
{
Console.WriteLine("List");
Console.WriteLine(new string('-', Console.WindowWidth - 5));
foreach (var item in redisIO.HGetAll("Dictonary"))
{
Console.WriteLine(StringExtensions.StringFromByteArray(item));
Console.WriteLine(new string('-', Console.WindowWidth - 5));
}
}
示例3: findlen
static void findlen()
{
using (var redisClient = new RedisClient(redisHost, Convert.ToInt16(redisPort)))
{
double totalsize = 0;
var keys = redisClient.GetAllKeys();
foreach (string key in keys)
{
try
{
byte[] bytarr = redisClient.Get(key);
double kblen = ConvertBytesToKilobytes(bytarr.Length);
double mblen = ConvertBytesToMegabytes(bytarr.Length);
totalsize = totalsize + mblen;
Console.WriteLine("Key Name : " + key + " Key length in MB : " + mblen + " Key Length in Kb : " + kblen);
using (System.IO.StreamWriter file = new System.IO.StreamWriter(@FilePathToStoreResult, true))
{
file.WriteLine("Key Name : " + key + " Key length in MB : " + mblen + " Key Length in Kb : " + kblen);
}
}
catch (Exception ex)
{
try
{
byte[][] bythsharr = redisClient.HGetAll(key);
double kblen = ConvertBytesToKilobytes(bythsharr.Length);
double mblen = ConvertBytesToMegabytes(bythsharr.Length);
Console.WriteLine("Hash Key Name : " + key + " Key length in MB : " + mblen + " Key Length in Kb : " + kblen);
using (System.IO.StreamWriter file =new System.IO.StreamWriter(@FilePathToStoreResult, true))
{
file.WriteLine("Hash Key Name : " + key + " Key length in MB : " + mblen + " Key Length in Kb : " + kblen);
}
totalsize = totalsize + mblen;
}
catch (Exception ex1)
{
}
}
}
}
}
示例4: ListItems
public static void ListItems(RedisClient redisDictionaryClient)
{
var allItems = redisDictionaryClient.HGetAll(ColectionKey);
for (int i = 0; i < allItems.Length; i = i + 2)
{
Console.WriteLine("Word: {0} - Translation: {1}",
Extensions.StringFromByteArray(allItems[i]), Extensions.StringFromByteArray(allItems[i + 1]));
}
Console.WriteLine();
}
示例5: PrintAllEntries
static void PrintAllEntries(RedisClient redisClient)
{
var entries = redisClient.HGetAll(DictionaryStructure);
for (int i = 0; i < entries.Length; i += 2)
{
Console.WriteLine(
"{0} -> {1}",
Extensions.StringFromByteArray(entries[i]),
Extensions.StringFromByteArray(entries[i + 1]));
}
}