Memcached Express Get started with C #

Source: Internet
Author: User

Source: http://www.cnblogs.com/wintersun/

Memcached is an open source high performance distributed cache component, which has been widely used in various Internet domains. Client development packages in multiple languages, including: Perl/php/java/c/python/ruby/c#/mysql. This site is already in use Youtube,reddit,zynga,facebook,orange it. See
The figure below compares the image.

It is also a platform for expansion, today we look at the server under Windows and access it using. NET clients. We
Enyim memcached is selected for this client.
First, we install the Windows version of the server, you can download from this site. To use the command line during installation:

Memcached.exe–d Install

This creates a memcached service in Windows service. You can also use –d Uninstall to uninstall it. Runtime will listen by default 11211
ip:127.0.0.1, as shown in:

Next, create a console program that references Enyim.Caching.dll, and in the configuration file:

   1:  <configuration>  
   2:    <configsections>  
   3:      <name= "enyim.com">   
   4:        <nametype= "Enyim.Caching.Configuration.MemcachedClientSection, enyim.caching" />    
   5:      </sectiongroup>  
   6:    </configsections>  
   7:    <enyim.com>  
   8:      <protocol= "Binary">   
   9:        <servers>  
  Ten:          <addressport= "11211"/>    
  One:        </servers>  
  :      </memcached>  
  £    </enyim.com>  
  :    </configuration>  

Test it:

   1:              New Memcachedclient ())
   2:              {
   3:                  "MyTime", DateTime.Now.ToString ());
   4:                  String temp = mc. get<string> ("MyTime");  
   5:  
   6:                  Console.Write (temp);
   7:                  console.read ();
   8:              }
Hope this article is helpful for your development.

Memcached Express Get started with C #

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.