惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

G
Google Developers Blog
人人都是产品经理
人人都是产品经理
腾讯CDC
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
WordPress大学
WordPress大学
S
SegmentFault 最新的问题
小众软件
小众软件
B
Blog
博客园 - 叶小钗
Microsoft Azure Blog
Microsoft Azure Blog
Apple Machine Learning Research
Apple Machine Learning Research
A
About on SuperTechFans
J
Java Code Geeks
Blog — PlanetScale
Blog — PlanetScale
博客园 - 司徒正美
博客园 - 【当耐特】
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Recent Announcements
Recent Announcements
宝玉的分享
宝玉的分享
Martin Fowler
Martin Fowler
Hugging Face - Blog
Hugging Face - Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Last Week in AI
Last Week in AI
V
V2EX

博客园 - dragonpig

Html 5 Canvas绘制分形图Mandelbrot .net中反射、emit、expression和dynamic的性能比较 const string 和 static readonly string的区别 SqlServer: Top N per Group 微软的BinarySearch 通过CTE实现Split CSV 通过SQL CTE计算Fibonacci 当json.js遇见dynamic.net烂尾篇 .NET线程安全泛型Singleton 跨域访问Cookie WCF JSON和AspnetCompatibility的配置 node.js初体验 教你如何制作Silverlight Visual Tree Inspector 一道非常有趣的概率题 教你30秒打造强类型ASP.NET数据绑定 当json.js遇见dynamic.net [0] 用Silverlight做雷达图 C#运算符重载不是没有用武之地 随机排列算法
Windows安装Memcached
dragonpig · 2011-02-18 · via 博客园 - dragonpig

Download [memcached.exe] [gui] and [.net lib]

memcached-1.2.6-win32-bin.zip
Memcached Manager
Memcached .NET client Library 

Add reference

\trunk\clientlib\src\clientlib\bin\2.0\Release\Memcached.ClientLibrary.dll

[Serializable]
class Student
{
public int ID { get; set; }
public string Name { get; set; }
public DateTime DOB { get; set; }
public override string ToString()
{
return string.Format("id:{0}, name:{1}, dob:{2}", ID, Name, DOB);
}
}
protected void Page_Load(object sender, EventArgs e)
{
MemInit();
MemSet();
MemGet();
}
void MemInit()
{
SockIOPool pool
= SockIOPool.GetInstance();
pool.SetServers(
new[] { "127.0.0.1:11211" });
pool.InitConnections
= 3;
pool.MinConnections
= 3;
pool.MaxConnections
= 5;
pool.SocketConnectTimeout
= 1000;
pool.SocketTimeout
= 3000;
pool.MaintenanceSleep
= 30;
pool.Failover
= true;
pool.Nagle
= false;
pool.Initialize();
}
void MemSet()
{
var mc
= new MemcachedClient();
mc.Set(
"string", "hello");
mc.Set(
"int", 99);
mc.Set(
"datetime", DateTime.Now);
mc.Set(
"person",
new Student { ID = 1, Name = "Mike", DOB = DateTime.Parse("1983/10/14") });
}
void MemGet()
{
var mc
= new MemcachedClient();
WriteLine((
string)mc.Get("string"));
WriteLine((
int)mc.Get("int"));
WriteLine((DateTime)mc.Get(
"datetime"));
WriteLine((Student)mc.Get(
"person"));
}
void WriteLine(object p)
{
Response.Write(p
+ "<br>");
}