MemcachedIt is an open-source high-performance distributed cache component and has been widely used in various Internet fields. client Development kits with multiple languages, including Perl/PHP/JAVA/C/Python/Ruby/C #/MySQL. this site is already using YouTube, Reddit, Zynga, Facebook, Orange. view
The following figure compares the image.
It is also a platform for expansion. Today we are looking at the server under windows and the client using. net to access it.
Select the client Enyim Memcached.
First, we install the windows server. You can download it from this site. Run the following command to install it:
Memcached.exe-d install
In this way, create a memcached service in Windows service. You can also use-d uninstall to uninstall it. The default listening 11211 will be used during runtime.
IP: 127.0.0.1, as shown in:
Create a console program to reference Enyim. Caching. dll, and in the configuration file:
1: <configuration>
2: <configSections>
3: <sectionGroup name="enyim.com">
4: <section name="memcached" type="Enyim.Caching.Configuration.MemcachedClientSection, Enyim.Caching"/>
5: </sectionGroup>
6: </configSections>
7: <enyim.com>
8: <memcached protocol="Binary">
9: <servers>
10: <add address="127.0.0.1" port="11211"/>
11: </servers>
12: </memcached>
13: </enyim.com>
14: </configuration>
Test:
1: using (var mc = new MemcachedClient())
2: {
3: mc.Store(StoreMode.Set, "mytime", DateTime.Now.ToString());
4: string temp = mc.Get<string>("mytime");
5:
6: Console.Write(temp);
7: Console.Read();
8: }
I hope this article will be helpful for your development.
Author: Petter Liu
Source: http://www.cnblogs.com/wintersun/
The copyright of this article is shared by the author and the blog Park. You are welcome to repost this article. However, you must retain this statement without the author's consent and provide a clear link to the original article on the article page. Otherwise, you will be held legally liable.
This article is also published in Petter Liu Blog, my independent Blog.