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

推荐订阅源

Martin Fowler
Martin Fowler
Microsoft Security Blog
Microsoft Security Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Vercel News
Vercel News
Y
Y Combinator Blog
D
DataBreaches.Net
IT之家
IT之家
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园_首页
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
H
Hackread – Cybersecurity News, Data Breaches, AI and More
WordPress大学
WordPress大学
H
Help Net Security
GbyAI
GbyAI
C
Check Point Blog
L
LangChain Blog
小众软件
小众软件
T
The Blog of Author Tim Ferriss
MyScale Blog
MyScale Blog
G
Google Developers Blog
月光博客
月光博客
V
V2EX
M
MIT News - Artificial intelligence
博客园 - 叶小钗

博客园 - 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>");
}