Gavin
2021-02-04 4e5aaefc7162b700b95c750caeff35e6323631d3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
using StackExchange.Redis;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
 
namespace Bro.Tool.Redis
{
    public class BroRedis
    {
        public static void Test()
        {
            using (ConnectionMultiplexer conn =  ConnectionMultiplexer.Connect("127.0.0.1:6379"))
            {
                IDatabase db = conn.GetDatabase();
                //往Redis里面写入一个Key为name的字符串
 
                double[,] data = new double[6,6];
 
                for (int i = 0; i < 6; i++)
                {
                    for (int j = 0; j < 6; j++)
                    {
                        data[i, j] = i * 6 + j;
                    }
                }
 
                //bool flag = db.StringSet("name", new double[6] );
                //读取数据
                //var a = db.StringGet("name");
            }
        }
 
        public string DataToString(double[][] data)
        {
            string str = "";
 
 
            return str;
 
        }
    }
}