Redis Series 1-use Redis (download and install) in C ),

Source: Internet
Author: User
Tags download redis

Redis Series 1-use Redis (download and install) in C ),

This article only describes the resources required to use Redis in Windows + C,Example of using Redis in C #The overall process is divided into three steps and implemented one by one in the order of titles.

1. download and install the Redis Service

You need to download the Redis service and install it in the operating system first. The installation steps are the same as installing other Windows programs. Here we will not spend any time talking about it. Download the applicable Redis service version (Windows 32-or 64-bit installation package) based on your operating system ). After downloading and installing apsaradb for Redis, start the apsaradb for Redis service in Windows.

Redis service: https://github.com/rgl/redis/downloads, directly jump to the download page from here.

2. Download Redis C # Development Library

Redis needs to be used in the C # project. It is actually programmed using a specific development library. The official Redis website provides many development libraries for C # clients. Among them, ServiceStack. Redis is popular and common. That is to say, we actually use the ServiceStack. Redis class library to develop Redis-related functions in the project. Here we will only talk about the use of ServiceStack. Redis.

First you need to download ServiceStack. Redis, ServiceStack. Redis in github is: https://github.com/ServiceStack/ServiceStack.Redis, or directly jump from here to the download page.

After the download is complete, reference the following class libraries to the project.

The above is an implementation method, but in project development, it is possible that team members may download different referenced versions, resulting in exceptions in other developers running the project. Therefore, this method is not recommended. In the Team Project, the most powerful IED visual studio in the universe already has a solution to this problem. I think many people have already guessed it. Yes, that's right. Use NuGet to install ServiceStack. Redis.

First, open the project in. Tool-NuGet Package Manager-Package Manager Console, enter:Install-Package ServiceStack. Redis,Select the project to use RedisPress the Enter key. At this time, vs will automatically download and reference the relevant development library in the project!

3. Development

You can refer to the following simple code example.

Related Article

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.