RedisClient client; private void button1_Click(object sender, EventArgs e) { //连接服务器 client = new RedisClient("192.168.18.160",6379); }
private void button2_Click(object sender, EventArgs e) { //存储用户名和密码 client.Set<string>("username","524300045@qq.com"); client.Set<int>("pwd", 123456); string username = client.Get<string>("username"); int pwd=client.Get<int>("pwd"); client.Set<decimal>("price", 12.10M); decimal price = client.Get<decimal>("price"); MessageBox.Show(price.ToString()); MessageBox.Show("用户名:"+username+",密码:"+pwd.ToString()); }