Exemplo n.º 1
0
 public static void Using(Action <Helper_Redis> a)
 {
     using (var red = new Helper_Redis())
     {
         a(red);
     }
 }
Exemplo n.º 2
0
        public static bool Test()
        {
            bool r = true;

            try
            {
                Helper_Redis.Using(rs => { rs.Use(current); });
            }
            catch (Exception e)
            {
                Helper_log.Write_Error("[Redis] test fail " + e.Message);
                r = false;
            }
            if (r)
            {
                Helper_log.Write_log("[Redis] test ok.");
            }
            return(r);
        }
Exemplo n.º 3
0
        private void Form1_Load(object sender, EventArgs e)
        {
            h_ini = new Helper_INI(str_ini);


            string r_ip   = h_ini.ReadString("redis", "ip2", "localhost");
            string r_port = h_ini.ReadString("redis", "port2", "6379");
            string r_pwd  = h_ini.ReadString("redis", "pwd2", "");
            int    r_DB   = h_ini.ReadInteger("redis", "db", 0);

            str_r_rec           = h_ini.ReadString("redis", "chan2", ""); //服务器的接收就是这边的发送
            str_r_rep           = h_ini.ReadString("redis", "chan1", ""); //服务器的发送频道就是这边的接收频道
            str_r_rec_disk      = h_ini.ReadString("redis", "key_disk", "");
            str_r_rec_disk_info = h_ini.ReadString("redis", "key_disk_info", "");

            str_search = h_ini.ReadString("DEFAULT", "scan_filter", ".avi,.mp4,.rmvb");

            h_redis = new Helper_Redis();
            h_redis.Use(r_ip, r_port, r_pwd, r_DB);

            h_redis.RedisSubMessageEvent += H_redis_RedisSubMessageEvent;
            h_redis.Use(r_DB).RedisSub(str_r_rec);
        }
Exemplo n.º 4
0
 private void b_Connect_Click(object sender, EventArgs e)
 {
     SetMyTextBoxValue(Helper_Redis.Test().ToString());
 }