Exemple #1
0
        private void button4_Click(object sender, EventArgs e)
        {
            var redis = RedisOperator.GetInstance();

            Dictionary <string, MonitorItemModel> list = redis.HashGetAll <MonitorItemModel>("010002FF-00AC-AC02-0003-0000FFFF0007");
            //MonitorItemModel item = redis.HashGet<MonitorItemModel>("010002FF-00AC-AC02-0003-0000FFFF0007", Newtonsoft.Json.JsonConvert.SerializeObject("回风温度"));
        }
Exemple #2
0
        private void button2_Click(object sender, EventArgs e)
        {
            var redis = RedisOperator.GetInstance();
            var item  = redis.LPop <UserInfoModel>("lingchen");

            if (item != null)
            {
                MessageBox.Show($"Name:{item.RealName}");
            }
            else
            {
                MessageBox.Show("null");
            }
        }
Exemple #3
0
        private void button1_Click(object sender, EventArgs e)
        {
            DateTime now = DateTime.Now;

            UserInfoModel[] users =
            {
                new UserInfoModel()
                {
                    Id       = 0,
                    Email    = "*****@*****.**",
                    Password = "******",
                    RealName = "凌晨",
                    Telphone = "17737618051",
                    Username = "******"
                },
                new UserInfoModel()
                {
                    Id       = 1,
                    Email    = "*****@*****.**",
                    Password = "******",
                    RealName = "凌晨1",
                    Telphone = "17737618052",
                    Username = "******"
                }, new UserInfoModel()
                {
                    Id       = 2,
                    Email    = "*****@*****.**",
                    Password = "******",
                    RealName = "凌晨2",
                    Telphone = "17737618053",
                    Username = "******"
                }, new UserInfoModel()
                {
                    Id       = 3,
                    Email    = "*****@*****.**",
                    Password = "******",
                    RealName = "凌晨3",
                    Telphone = "17737618054",
                    Username = "******"
                }
            };

            var redis = RedisOperator.GetInstance();

            redis.RPush <UserInfoModel>("lingchen", users);

            MessageBox.Show((DateTime.Now - now).TotalMilliseconds.ToString());
        }
Exemple #4
0
 private void button6_Click(object sender, EventArgs e)
 {
     var redis = RedisOperator.GetInstance();
     Dictionary <string, string> list = redis.HashGetAll <string>("zxm");
     //string list = redis.HashGet<string>("zxm","zxm");
 }
Exemple #5
0
 private void button5_Click(object sender, EventArgs e)
 {
     var  redis = RedisOperator.GetInstance();
     bool b     = redis.HashSet <string>("zxm", "zxm", "zhengxumei");
     bool b1    = redis.HashSet <string>("zxm", "zxm1", "zhengxumei1");
 }
Exemple #6
0
 internal CollectorBusiness(string connStr)
 {
     _mySQLHelper = new MysqlOperator(connStr);
     _redisHelper = RedisOperator.GetInstance();
 }