【发布时间】:2014-03-21 12:47:23
【问题描述】:
我有以下基本的 C# 控制台应用程序方法,它将字符串写入内存缓存。我正在寻找一种方法来...
1) 序列化它(不使用 XML) 2)放入memcache 3)反序列化是(不使用XML) 4) 放入字符串
using (MemcachedClient client = new MemcachedClient())
{
client.FlushAll();
// store the value
client.Store(StoreMode.Set, "myObj", "testval");
// retrieve the value
string value = client.Get<string>("myObj");
Console.WriteLine(value);
Console.ReadLine();
}
有没有人有一个如何做到这一点的基本示例。
谢谢。
【问题讨论】:
-
只需将字符串转换为 UTF-8。
标签: c# serialization memcached