stackexchange.redis

2020-02-25 15:13:59 浏览数 (1)

redis客户端

代码语言:javascript复制
using ControlSystem.Log;
using StackExchange.Redis;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.IO;
using System.Linq;
using System.Net;
using System.Runtime.Serialization.Formatters.Binary;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace ControlSystem.Redis
{
    public class RedisClient
    {
        ConnectionMultiplexer m_connect;

        int m_redisPort = 6379;
        string m_redisIP;
        
        EndPoint[] EndPoints { get { return m_connect.GetEndPoints(); } }
        IDatabase DataBase { get { return m_connect.GetDatabase(); } }
        IServer GetServer { get { return m_connect.GetServer(m_redisIP, m_redisPort); } }

        public RedisClient()
        {
            string connect = ConfigurationManager.ConnectionStrings["Redis"].ConnectionString;
            if (!string.IsNullOrEmpty(connect))
            {
                string[] context 

0 人点赞