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学习心得(五) 运 ...
随机推荐
- iOS web与js的简单交互
我们在封装网页的时候经常会遇到需要往网页里面的控件添加数据,但是怎么添加又成了难点.本人最近在开发的时候就遇到这样的事,解决之后,来和大家分享一下. //以必应网站为例 [web loadReques ...
- 关于c#中委托使用小结
一.简述: 委托对与我们编程人员来说,一点都不陌生,在实际工作过程中,或多或少都应该是接触过 但是对与编程新手来说,对与委托的理解和使用应该还是一个坎,但是只要理解清楚了,这个坎也就过去了. 最近也经 ...
- Java基础知识强化之多线程笔记02:多线程之 面试题(常问)
1. 多线程有几种实现方案,分别是哪几种 ? 两种. 继承Thread类 实现Runnable接口 扩展一种:实现Callable接口.这个得和线程池结合. 2. 同步有几种方式,分别是什么? ...
- 例3-13设置ROI
写在前面,写的时候总有种给别人写的感觉,然后就写得很冗长,也没有办法很好的表达自己的想法,总觉得写得越多越好,实则不然,要最言简意赅,还能表达意思. 嗯! 只写自己不明白的地方,如果恰巧有人也看了我的 ...
- debian 颜色设置
root@debian:/# vi /root/.bashrc #export PS1='\h:\w\$ 'export PS1='\[\033[1;32;40m\]\u@\h:\w\$ \[\033 ...
- LogstashL reference 重要章节
配置文件结构说明 https://www.elastic.co/guide/en/logstash/current/configuration-file-structure.html Event相关配 ...
- java基础学习总结三(jdk7新特性、变量(局部变量和成员变量)、常量以及运算符)
一:jdk7新特性 可以表示二进制数值,以0b开头,中间可以使用下划线_分隔符.如下: @Test /** * 测试jdk新特性 */ public void testJdk7(){ int a=0b ...
- Linux 的使用基础---Shell程序设计
Shell是Linux系统中的一个重要的层次,它是用户与系统交互作用的界面.Shell除了作为命令解释程序以外,还是一种高级程序设计语言.利用Shell程序设计语言可以编写出功能很强.但代码简单的程序 ...
- js父窗口opener与parent
parent表示父窗口,比如一个A页面利用iframe或frame调用B页面,那么A页面所在窗口就是B页面的parent.在JS 中,window.opener只是对弹出窗口的母窗口的一个引用.比如: ...
- 中国地图投影(实现Lambert投影)
一.简介 目前Web地图已经是一个非常普遍的应用,百度地图,高德地图等等极大的方便了我们的生活和学习.本项目主要是在Web完成一个简单的中国地图的绘制,实现Lambert投影. 二.制图源数据信息及来 ...