Windows sever package: http://code.google.com/p/servicestack/wiki/RedisWindowsDownload
Windows is only used for testing, and its performance is not as high as that in Linux.
C # usage:
Referenced servicestackredis: https://github.com/mythz/ServiceStack.Redis
Static void main (string [] ARGs) {var redis = new redisclient ("127.0.0.1", 6379 ); // redis service IP address and port # region = insert = // var storemembers = new list <string> {"JJ", "Lihui", "cc"}; // storemembers. foreach (x => redis. additemtolist ("additemtolist", x); // Note: You can directly use the addrangetolist method to load a group of data, for example: // redis. addrangetolist ("additemtolist", storemembers); # endregion # region = get = // var members = redis. getallitemsfromlist ("additemtolist"); // members. foreach (S => console. writeline ("additemtolist:" + S); // console. writeline (redis. getitemfromlist ("additemtolist", 2); # endregion # region = Delete = // var list = redis. lists ["additemtolist"]; // list. clear (); // clear // list. remove ("two"); // remove the specified key value // list. removeat (2); // remove the data at the specified index position # endregion # region = Object = // redis. set ("userinfo", new userinfo () {username = "", age = 45}); // userinfo = redis. get <userinfo> ("userinfo"); // console. writeline (userinfo. username); // redis. set <int> ("my_age", 12); // or redis. set ("my_age", 12); // console. writeline (redis. get <int> ("my_age"); # endregion var SER = new objectserializer (); // located in namespace servicestack. redis. support; # region = serialization = // bool result = redis. set <byte []> ("userinfo", Ser. serialize (New userinfo () {username = "Zhang San", age = 12}); // userinfo = Ser. deserialize (redis. get <byte []> ("userinfo") as userinfo; // console. writeline (userinfo. username); # endregion // list is also supported // redis. set <byte []> ("userinfolist_serialize", Ser. serialize (userinfolist); # region = Server Load balancer = pooledredisclientmanager prcm = createmanager (New String [] {"10.0.4.210: 6379"}, new string [] {"10.0.4.210: 6379 "}); List <userinfo> userinfolist = new list <userinfo> (); userinfolist. add (New userinfo () {username = "pool_daizhj", age = 1}); userinfolist. add (New userinfo () {username = "pool_daizhj1", age = 2}); // obtain a link from the pool: Using (iredisclient redis2 = prcm. getclient () {redis2.set ("userinfolist", userinfolist); List <userinfo> userlist = redis2.get <list <userinfo> ("userinfolist") ;}# endregion console. readline ();} public static pooledredisclientmanager createmanager (string [] readwritehosts, string [] readonlyhosts) {// read/write splitting is supported, and the returned load is new pooledredisclientmanager (readwritehosts, new redisclientmanagerconfig {maxwritepoolsize = 5, // "write" link pool connection count maxreadpoolsize = 5, // "write" link pool connection count autostart = true ,});}
Collected from the Internet, only for your own data records.