标签:
如果还没有配置Azure Power shell 可以参照这里进行配置:打开Azure Power Shell
Add-AzureAccount
New-AzureManagedCache -Name mycache -Location "South Central US" -Sku Basic -Memory 128MB
4. 点击菜单Redis Caches 可以看到redis已经创建好了:
static void Main(string[] args)
{
ConnectionMultiplexer connection =
ConnectionMultiplexer.Connect("your_domain.redis.cache.windows.net,ssl=true,password=YourPrimaryKey");
IDatabase cache = connection.GetDatabase();
// Perform cache operations using the cache object...
// Simple put of integral data types into the cache
cache.StringSet("key1", "value");
cache.StringSet("key2", 25);
// Simple get of data types from the cache
string key1 = cache.StringGet("key1");
Console.WriteLine(key1);
int key2 = (int)cache.StringGet("key2");
Console.WriteLine(key2);
Console.Read();
}版权声明:本文为博主原创文章,未经博主允许不得转载。
Windows Azure 系列-- Azure Redis Cache的配置和使用
标签:
原文地址:http://blog.csdn.net/lan_liang/article/details/46850249