예제 #1
0
파일: Form1.cs 프로젝트: a602123/CMA
        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("回风温度"));
        }
예제 #2
0
        private MessageBusiness()
        {
            string connStr = System.Configuration.ConfigurationManager.AppSettings["RedisConnectString"];

            _redis     = RedisOperator.NewInstance(connStr);
            _workState = false;
        }
예제 #3
0
        private CollectorBusiness()
        {
            _collectorList = new List <string>();
            string connStr = System.Configuration.ConfigurationManager.AppSettings["RedisConnectString"];

            _redis = RedisOperator.NewInstance(connStr);

            _checkCollectorStateInterval = Convert.ToInt32(ConfigurationManager.AppSettings["CheckCollectorStateInterval"]);
            _collectorStateKeyInRedis    = ConfigurationManager.AppSettings["CollectorStateKeyInRedis"];
        }
예제 #4
0
파일: Form1.cs 프로젝트: a602123/CMA
        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");
            }
        }
예제 #5
0
파일: Form1.cs 프로젝트: a602123/CMA
        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());
        }
예제 #6
0
        static void Main(string[] args)
        {
            //string RedisConnectionString = ConfigurationManager.ConnectionStrings["RedisExchangeHosts"]?.ConnectionString;
            string SysCustomKey = ConfigurationManager.AppSettings["redisKey"] ?? "";

            var db = new RedisOperator(DbIndex);

            db.CustomKey = SysCustomKey;

            Console.WriteLine("start");
            for (int i = 0; i < 100; i++)
            {
                string key    = $"A{i}";
                var    result = db.StringSet(key, i, TimeSpan.FromSeconds(1 * (i + 1)));

                Console.WriteLine(key);
            }
            Console.WriteLine("end");
        }
 public RedisOperatorTest()
 {
     db           = new RedisOperator(DbIndex, RedisHost);
     db.CustomKey = CustomKey;
 }
예제 #8
0
파일: Form1.cs 프로젝트: a602123/CMA
 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");
 }
예제 #9
0
파일: Form1.cs 프로젝트: a602123/CMA
 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");
 }
예제 #10
0
 internal CollectorBusiness(string connStr)
 {
     _mySQLHelper = new MysqlOperator(connStr);
     _redisHelper = RedisOperator.GetInstance();
 }