appfabric 简单应用
http://msdn.microsoft.com/en-us/library/ee790941(v=azure.10).aspx
Preparing the Visual Studio Project
http://msdn.microsoft.com/en-us/library/ee790876(v=azure.10).aspx
To initialize and start your cache cluster:
Use-CacheCluster
New-Cache
Grant-CacheAllowedClientAccount
Start-CacheCluster
Open your Visual Studio .NET project.
In Solution Explorer, right-click the project name and then select Add Reference.
Select the Browse tab of the Add Reference dialog.
Navigate to the .\Windows\System32\AppFabric directory.
Add a reference to the following two assemblies: Microsoft.ApplicationServer.Caching.Client.dll and Microsoft.ApplicationServer.Caching.Core.dll.
Optionally, add the using statement (Imports in Visual Basic) at the top of the code files to reference the Microsoft.ApplicationServer.Caching namespace.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks; using Microsoft.ApplicationServer.Caching; namespace AppFabricCaching
{
class Program
{
[Serializable]
class User
{
public string name;
public string gender;
public int age; public override string ToString()
{
return "name:" + name + System.Environment.NewLine +
"gender:" + gender + System.Environment.NewLine +
"age:" + age.ToString();
}
}
static void Main(string[] args)
{ //To configure a cache client programmatically
DataCacheServerEndpoint[] servers = new DataCacheServerEndpoint[];
servers[] = new DataCacheServerEndpoint("sv1", );
DataCacheFactoryConfiguration factoryConfig = new DataCacheFactoryConfiguration();
factoryConfig.Servers = servers;
// Create a configured DataCacheFactory object.
DataCacheFactory mycacheFactory = new DataCacheFactory(factoryConfig);
// Get a cache client for the cache "NamedCache1".
DataCache myDefaultCache = mycacheFactory.GetCache("NamedCache1"); var cache = myDefaultCache;
cache.Add("zy", new User() { name="zy", gender="m", age= });
var user = (User)cache.Get("zy");
Console.WriteLine(user.ToString()); Console.ReadLine(); }
}
}
appfabric 简单应用的更多相关文章
- Windows Server AppFabric 安装文档
安装指南 入门标题页 3 Windows Server AppFabric 安装和配置指南 3 版权 3 版权所有 3 简介 3 清单:规划安装 4 硬件要求 4 使计算机作好安装准备 5 本节内容 ...
- 浅谈Windows Server APPFABRIC
hi,everyone !真的是好久好久没有update blog了,因为最近忙着备考,没有时间对<数据结构与算法>进行研究学习了.所以,blog一直未更新.today is Friday ...
- Windows Server AppFabric分布式缓存研究
分享一则先前对Windows Server AppFabric分布式缓存的技术研究. 一. AppFabric 技术架构和原理 AppFabric与Memcached类似,采用C/S的模式,在 ser ...
- 【造轮子】打造一个简单的万能Excel读写工具
大家工作或者平时是不是经常遇到要读写一些简单格式的Excel? shit!~很蛋疼,因为之前吹牛,就搞了个这东西,还算是挺实用,和大家分享下. 厌烦了每次搞简单类型的Excel读写?不怕~来,喜欢流式 ...
- Fabio 安装和简单使用
Fabio(Go 语言):https://github.com/eBay/fabio Fabio 是一个快速.现代.zero-conf 负载均衡 HTTP(S) 路由器,用于部署 Consul 管理的 ...
- node.js学习(三)简单的node程序&&模块简单使用&&commonJS规范&&深入理解模块原理
一.一个简单的node程序 1.新建一个txt文件 2.修改后缀 修改之后会弹出这个,点击"是" 3.运行test.js 源文件 使用node.js运行之后的. 如果该路径下没有该 ...
- 哪种缓存效果高?开源一个简单的缓存组件j2cache
背景 现在的web系统已经越来越多的应用缓存技术,而且缓存技术确实是能实足的增强系统性能的.我在项目中也开始接触一些缓存的需求. 开始简单的就用jvm(java托管内存)来做缓存,这样对于单个应用服务 ...
- 在Openfire上弄一个简单的推送系统
推送系统 说是推送系统有点大,其实就是一个消息广播功能吧.作用其实也就是由服务端接收到消息然后推送到订阅的客户端. 思路 对于推送最关键的是服务端向客户端发送数据,客户端向服务端订阅自己想要的消息.这 ...
- 我的MYSQL学习心得(一) 简单语法
我的MYSQL学习心得(一) 简单语法 我的MYSQL学习心得(二) 数据类型宽度 我的MYSQL学习心得(三) 查看字段长度 我的MYSQL学习心得(四) 数据类型 我的MYSQL学习心得(五) 运 ...
随机推荐
- Python 基础【第十篇】内置类型
一.integral 类型 Python提供了两种integral类型,即int(整数)与bool(布尔值). 1.1.整数 整数的相关运算符.函数.数据类型转换 1.1.1.整数的运算符 前面已经讲 ...
- ArrayUtils用法
/* 1. ArrayUtils.isEmpty(strs) : 判断数组是否为空 , 不为空返回false,为空true */ ArrayUtils.isEmpty(new String[] ...
- MVC 表单提交提示:已添加了具有相同键的项。
MVC:页面提交的时候报如下错误: 解决方案: 这个Model 里面定义了重复的字段so~~~
- 总结&记录
一.Git(linux命令) 1.tar 压缩/解压 -c 建立一个压缩文件(create) -x 解压一个压缩文件 -t 查看tarfile中文件 -z 是否具有gzip的属性?是否需要用gzip ...
- Xcode7 网络请求报错
xcode7 网络报错: The resource could not be loaded because the App Transport Security policy reguir 原因:iO ...
- 第二十四篇、iOS 10版本适配
随着iOS10发布的临近,大家的App都需要适配iOS10,下面是我总结的一些关于iOS10适配方面的问题,如果有错误,欢迎指出. 1.系统判断方法失效: 在你的项目中,当需要判断系统版本的话,不要使 ...
- 代理的使用 一(helloworld级别)
个人理解(估计,半年一年后,在看到这篇文章的时候,会觉得,当时真的弱爆了) 当我们自定义view的时候,比如说view上面有几个按钮,那么我们在别的地方使用这个view的时候,怎么来处理这些点击事件呢 ...
- freemark页面中获取list循环中的counter
如何在freemark页面中获取到当前list循环的counter 直接上代码 <#list lists as x> <#assign j=x?counter> ${j} // ...
- Could not find action or result 导致 页面出现404错误
注意一下语句的写法(在login.jsp中的action) 在 struts.xml中 <action name="login" class="action.Lo ...
- 【制作镜像Win*】特殊配置
下载disk.config: wget http://10.254.3.75/images/configdrive/disk.config 修改libvirt.xml,更换cdrom为disk.con ...