Catatan Rilis
Pengumuman
using System.Collections.Generic;using System.Linq;using System.Text;using ServiceStack.Redis;using System;namespace ConsoleApplication1{class Program{static void Main(string[] args){string host = "10.xx.xx.46";// Alamat host untuk mengakses instansint port = 6379;// Informasi portstring instanceId = "bd87dadc-8xx1-4xx1-86dd-021xxxcde96";// ID Instansstring pass = "1234567q";// Kata sandiRedisClient redisClient = new RedisClient(host, port, instanceId + ":" + pass);string key = "name";string value = "QcloudV5!";redisClient.Set(key, value); // Atur nilaiSystem.Console.WriteLine("set key:[" + key + "]value:[" + value + "]");string getValue = System.Text.Encoding.Default.GetString(redisClient.Get(key)); // Baca nilaiSystem.Console.WriteLine("value:" + getValue);System.Console.Read();}}}
using System.Collections.Generic;using System.Linq;using System.Text;using ServiceStack.Redis;using System;namespace ConsoleApplication2{class Program{static void Main(string[] args){string[] testReadWriteHosts = new[] {"redis://:fb92bxxxabf11e5:1234xx8a1A@10.x.x.1:6379"/*redis://:instance ID:password@access address:port*/};RedisConfig.VerifyMasterConnections = false;// Perlu diaturPooledRedisClientManager redisPoolManager = new PooledRedisClientManager(10/*connection pool quantity*/,10/*connection pool timeout period*/, testReadWriteHosts);for (int i = 0; i < 100; i++){IRedisClient redisClient = redisPoolManager.GetClient();// Dapatkan koneksiRedisNativeClient redisNativeClient = (RedisNativeClient)redisClient;redisNativeClient.Client = null;// Perlu diaturtry{string key = "test1111";string value = "test1111";redisClient.Set(key, value);redisClient.Dispose();//}catch (Exception e){System.Console.WriteLine(e.Message);}}System.Console.Read();}}}
using System.Collections.Generic;using System.Linq;using System.Text;using ServiceStack.Redis;using System;namespace ConsoleApplication3{class Program{static void Main(string[] args){string[] testReadWriteHosts = new[] {"fb92bfxxbf11e5:123456xx1A@10.x.x.1:6379" /*instance ID:password@access address:port*/};PooledRedisClientManager redisPoolManager = new PooledRedisClientManager(10/*connection poolquantity*/, 10/*connection pool timeout period*/, testReadWriteHosts);for (int i = 0; i < 100; i++){IRedisClient redisClient = redisPoolManager.GetClient();// Dapatkan koneksitry{string key = "test1111";string value = "test1111";redisClient.Set(key, value);redisClient.Dispose();//}catch (Exception e){System.Console.WriteLine(e.Message);}}System.Console.Read();}}}

Apakah halaman ini membantu?
Anda juga dapat Menghubungi Penjualan atau Mengirimkan Tiket untuk meminta bantuan.
masukan