<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom"><title type="text">博客园_ChaunceyHao</title><subtitle type="text">Web标准的思想应该是实现结构，表现，行为的分离!</subtitle><id>http://feed.cnblogs.com/blog/u/39701/rss</id><updated>2012-02-10T15:52:23Z</updated><author><name>ChaunceyHao</name><uri>http://www.cnblogs.com/shihao/</uri></author><generator>CNBlogs BlogServer</generator><link rel="alternate" type="text/html" href="http://www.cnblogs.com/shihao/"/><link rel="self" type="application/atom+xml" href="http://feed.cnblogs.com/blog/u/39701/rss"/><entry><id>http://www.cnblogs.com/shihao/archive/2012/02/10/2346138.html</id><title type="text">Eclipse Virgo 3.0发布了</title><summary type="text">近日，Eclipse Virgo项目发布了3.0版，完成了Spring DM server项目到Eclipse的过渡。此次发布还解决了最后一个难题，Gemini Web组件，它现在通过了所有针对WAB部署的OSGi企业测试。 Eclipse Virgo提供了一个类似于Tomcat的运行时环境，可以安装bundle与bundle集（PARs），并将其当作是服务端应用。Virgo使用了 region的概念，可以将用户安装的程序（user region）与Virgo运行时空间（kernel region）分开。 之前，这种划分是通过嵌套框架强制进行的，但最近得到了更新，能够支持bundle dig.</summary><published>2012-02-10T13:47:00Z</published><updated>2012-02-10T13:47:00Z</updated><author><name>ChaunceyHao</name><uri>http://www.cnblogs.com/shihao/</uri></author><link rel="alternate" href="http://www.cnblogs.com/shihao/archive/2012/02/10/2346138.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/shihao/archive/2012/02/10/2346138.html"/><content type="html">&lt;div&gt;&lt;p&gt;近日，&lt;a href="http://www.eclipse.org/virgo/"&gt;Eclipse Virgo&lt;/a&gt;项目发布了&lt;a href="http://underlap.blogspot.com/2011/08/new-releases-virgo-30-and-gemini-web-20.html"&gt;3.0版&lt;/a&gt;，完成了Spring DM server项目到Eclipse的过渡。此次发布还解决了最后一个难题，Gemini Web组件，它现在通过了所有针对WAB部署的OSGi企业测试。&lt;/p&gt; &lt;p&gt;Eclipse  Virgo提供了一个类似于Tomcat的运行时环境，可以安装bundle与bundle集（PARs），并将其当作是服务端应用。Virgo使用了 region的概念，可以将用户安装的程序（user region）与Virgo运行时空间（kernel region）分开。&lt;/p&gt; &lt;p&gt;之前，这种划分是通过嵌套框架强制进行的，但最近得到了更新，能够支持&lt;a href="http://underlap.blogspot.com/2011/05/equinox-digraph-ready-for-use.html"&gt;bundle digraph&lt;/a&gt;，它使用了Equinox实现来提供分区。由于是Equinox的一部分，因此它能够用在Virgo外部，使用普通的基于Equinox的OSGi运行时；当其他OSGi框架能够支持新的解析器时，它也能移植到其他OSGi运行时上。&lt;/p&gt; &lt;p&gt;此次发布的另一个新特性就是提供了一个bundle，该bundle提供了Web组件的Jetty支持（虽然Tomcat支持也包含进来了）。这样就实现了与Equinox RT栈中其他组件更紧密的支持。&lt;/p&gt; &lt;p&gt;默认情况下，运行时已经从Felix切换到了Equinox，这么做的目的在于实现region划分。然而，这一点可能并不为人所知，因为在默认情况下，Virgo已经包含了Felix Gogo shell（用于telnet与ssh连接）。&lt;/p&gt; &lt;p&gt;与服务器一样，有一个名为&lt;a href="http://www.eclipse.org/virgo/documentation/virgo-documentation-3.0.0.RELEASE/docs/snaps-guide/htmlsingle/virgo-snaps-guide.html"&gt;snaps&lt;/a&gt;（之 前叫做SpringSource  slices）的Web应用框架，它允许URL重叠的Web应用一起托管在同一个Web服务器上，并且可以共享一些数据。WABs（符合OSGi的 WARs）可以将服务与URLs注册到&amp;#8220;托管&amp;#8221;应用中，你可以编程的方式（或是使用JSP标签库）让该托管应用动态遍历可用的已安装组件。目 前，snaps需要使用Eclipse Virgo才能运行。支持Eclipse Virgo的大量IDE插件&lt;a href="http://wiki.eclipse.org/Virgo/Tooling"&gt;目前正处在开发当中&lt;/a&gt;。&lt;/p&gt; &lt;p&gt;希望进行基于Web的OSGi开发以及了解过众多Spring概念的开发者会发现通过Eclipse Virgo可以轻松过渡到OSGi世界中。感兴趣的读者可以阅读该&lt;a href="http://www.eclipse.org/virgo/samples/"&gt;教程&lt;/a&gt;以及&lt;a href="http://www.eclipse.org/virgo/documentation/"&gt;用户与开发者文档&lt;/a&gt;。你可以现在就&lt;a href="http://www.eclipse.org/virgo/download/"&gt;下载&lt;/a&gt;Virgo 3.0。&lt;/p&gt; &lt;p&gt;&lt;strong&gt;查看英文原文：&lt;/strong&gt;&lt;a href="http://www.infoq.com/news/2011/09/eclipse-virgo"&gt;Eclipse Virgo 3.0 Released&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;&lt;img src="http://www.cnblogs.com/shihao/aggbug/2346138.html?type=1" width="1" height="1" alt=""/&gt;&lt;p&gt;&lt;a href="http://www.cnblogs.com/shihao/archive/2012/02/10/2346138.html" target="_blank"&gt;本文链接&lt;/a&gt;&lt;/p&gt;</content></entry><entry><id>http://www.cnblogs.com/shihao/archive/2012/02/10/2346136.html</id><title type="text">2012，C++，学，还是不学？</title><summary type="text">珠三角技术沙龙组委会成员、发起人之一赖勇浩近期的一篇博客引起社区内热烈讨论。他在其中认为：C++是2012年不宜进入的三个技术点之一；其他两个是：ActionScript/MXML,线程。 赖勇浩对于“不宜进入”的定义是： 如果你现在不是这三个技术点的专家，并且手上没有使用这三个技术点的项目，进入这三个技术点仅为技术储备，那么就“不宜进入”。 至于为什么不宜进入，赖勇浩认为根本原因在于： 标准化过程中的超长流程，一次次将 C++ 推向深渊。 接下来，赖勇浩首先回顾了20世纪90年代： 其实在 90 年代，计算机的运算能力有限，市场上非常需要一款性能较高、抽象较强的编程语言，C++ 获...</summary><published>2012-02-10T13:42:00Z</published><updated>2012-02-10T13:42:00Z</updated><author><name>ChaunceyHao</name><uri>http://www.cnblogs.com/shihao/</uri></author><link rel="alternate" href="http://www.cnblogs.com/shihao/archive/2012/02/10/2346136.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/shihao/archive/2012/02/10/2346136.html"/><content type="html">&lt;div&gt;&lt;p&gt;&lt;a href="http://techparty.org/"&gt;珠三角技术沙龙&lt;/a&gt;组委会成员、发起人之一&lt;a href="http://laiyonghao.com/"&gt;赖勇浩&lt;/a&gt;近期的&lt;a href="http://blog.csdn.net/lanphaday/article/details/7223385"&gt;一篇博客&lt;/a&gt;引起社区内热烈讨论。他在其中认为：C++是2012年不宜进入的三个技术点之一；其他两个是：&lt;a href="http://blog.csdn.net/lanphaday/article/details/7217506"&gt;ActionScript/MXML&lt;/a&gt;,&amp;nbsp;&lt;a href="http://blog.csdn.net/lanphaday/article/details/7218611"&gt;线程&lt;/a&gt;。&lt;/p&gt; &lt;p&gt;赖勇浩对于&amp;#8220;不宜进入&amp;#8221;的定义是：&lt;/p&gt; &lt;blockquote style='border:2px solid #EFEFEF;color:#333333;padding:5px 10px;'&gt; &lt;p&gt;如果你现在不是这三个技术点的专家，并且手上没有使用这三个技术点的项目，进入这三个技术点仅为技术储备，那么就&amp;#8220;不宜进入&amp;#8221;。&lt;/p&gt; &lt;/blockquote&gt; &lt;p&gt;至于为什么不宜进入，赖勇浩认为根本原因在于：&lt;/p&gt; &lt;blockquote style='border:2px solid #EFEFEF;color:#333333;padding:5px 10px;'&gt; &lt;p&gt;标准化过程中的超长流程，一次次将 C++ 推向深渊。&lt;/p&gt; &lt;/blockquote&gt; &lt;p&gt;接下来，赖勇浩首先回顾了20世纪90年代：&lt;/p&gt; &lt;blockquote style='border:2px solid #EFEFEF;color:#333333;padding:5px 10px;'&gt; &lt;p&gt;其实在 90 年代，计算机的运算能力有限，市场上非常需要一款性能较高、抽象较强的编程语言，C++ 获得了成功，但它标准化的时间过长，造成各种编译器有各自互不兼容的&amp;#8220;方言&amp;#8221;，成了它的第一个软肋。&lt;/p&gt; &lt;/blockquote&gt; &lt;p&gt;然后，赖勇浩又指出：&amp;#8220;C++ 在 21 世纪的第一个十年里仍然地位稳固&amp;#8221;，其原因在于：&amp;#8220;Linux 和 MacOS X 大获成功，在这两个平台上 C++ 都是非常有竞争力的编程语言，C++ 自然水涨船高。&amp;#8221;&lt;/p&gt; &lt;p&gt;但是，赖勇浩提出开发效率成为阻挡更多人采用C++的另一个因素：&lt;/p&gt; &lt;blockquote style='border:2px solid #EFEFEF;color:#333333;padding:5px 10px;'&gt;但随着 web2.0 和 web app 概念的兴起，以及 CPU  的主频进一步提升，服务器端编程语言渐渐地对执行效率不再敏感，而是更在意程序员的开发效率，众多的脚本语言开始蚕食 C++  的市场份额&amp;#8943;&amp;#8943;新兴的贵族是动态语言。面对动态语言在开发效率上的强劲挑战，C++ 社区除了在 2003 年对 C++98 做了小小的  patch，基本上睡着了，完全没有应对之策，哦不，连应用的姿态都没有。&lt;/blockquote&gt; &lt;p&gt;在赖勇浩看来，&lt;/p&gt; &lt;blockquote style='border:2px solid #EFEFEF;color:#333333;padding:5px 10px;'&gt;进入 21 世纪的第二个十年，&amp;#8943;&amp;#8943;在这个十年，我们需要这样的编程语言： &lt;ol&gt;&lt;li&gt;能充分利用现代 CPU 的计算能力，不仅仅是多个核心，更是巨大的 L1/L2/L3 Cache、超线程等；&lt;/li&gt;&lt;li&gt;能够大量减小异步 I/O 的性能提升的同时带来的副作用：异步编程的复杂性以及对可维护性的伤害&lt;/li&gt;&lt;/ol&gt; 两句话其实也可以压缩为一句：需要有更好的并发模型的语言。&lt;/blockquote&gt; &lt;p&gt;上述主要针对服务器编程领域，在桌面和移动领域，赖勇浩认为：&lt;/p&gt; &lt;blockquote style='border:2px solid #EFEFEF;color:#333333;padding:5px 10px;'&gt; &lt;p&gt;rust 会进入桌面开发，google go 肯定会顺道啃一口。而移动设备方面，&amp;#8943;&amp;#8943;编译型语言加脚本的模式就会占大头&amp;#8943;&amp;#8943;C++还是前景堪忧。&lt;/p&gt; &lt;/blockquote&gt; &lt;p&gt;最后，赖勇浩的总结是：&lt;/p&gt; &lt;blockquote style='border:2px solid #EFEFEF;color:#333333;padding:5px 10px;'&gt; &lt;p&gt;回首 C++ 的 30 年，展望它的未来，总结起来可能就是：标准化流程拖死人了。如果不是 15 年不能标准化，java/c# 的搅局可能不会出现；如果在 2005 年能够应对动态语言&amp;#8230;&amp;#8230;如果云时代有更好的并发模型&amp;#8230;&amp;#8230;&lt;/p&gt; &lt;/blockquote&gt; &lt;p&gt;对于赖勇浩的观点，知乎上有人提出&lt;a href="http://www.zhihu.com/question/20042037"&gt;质疑&lt;/a&gt;，知名C++程序员&lt;a href="http://weibo.com/giantchen"&gt;陈硕&lt;/a&gt;做出了&lt;a href="http://zhi.hu/BuMI"&gt;回应&lt;/a&gt;，他认为：&lt;/p&gt; &lt;blockquote style='border:2px solid #EFEFEF;color:#333333;padding:5px 10px;'&gt; &lt;p&gt;C++目前坚守的阵地：服务端基础架构（例如淘宝&lt;a href="http://rdc.taobao.com/blog/cs/?cat=97"&gt;OceanBase&lt;/a&gt;是C++写的），PC客户端的3D游戏（DirectX是提供COM/C++接口），某些嵌入式上的(准/软)实时程序，其他Java/C#/Python未能涉足的领域（会遇到C的抵抗）。如果你正好在这几个领域，我看不出有担心的必要。&lt;/p&gt; &lt;/blockquote&gt; &lt;p&gt;陈硕还指出：&lt;/p&gt; &lt;blockquote style='border:2px solid #EFEFEF;color:#333333;padding:5px 10px;'&gt; &lt;p&gt;C++目前仍然是最快的语言（见 google language benchmark 论文和&amp;nbsp;&lt;a href="http://shootout.alioth.debian.org/" target="_blank"&gt;shootout.alioth.debian.org/&lt;/a&gt;）。如果你的应用领域确实在乎这个性能&amp;#8943;&amp;#8943;那么 C++ 仍然是不二之选。&lt;/p&gt; &lt;/blockquote&gt; &lt;p&gt;技术博客&lt;a href="http://coolshell.cn/"&gt;酷壳&lt;/a&gt;的博主陈皓对此次讨论也发表了一篇博客《Why C++ ? 王者归来》，他在其中引用了&lt;a href="http://herbsutter.com/" target="_blank"&gt;Herb Sutter&lt;/a&gt;的一次演讲，Herb Sutter是&lt;a href="http://book.douban.com/subject/1752968/"&gt;Exceptional C++&lt;/a&gt;和&lt;a href="http://book.douban.com/subject/1459007/"&gt;C++ Coding Standards&lt;/a&gt;的作者、ISO C++委员会的主席、C++/CLI首席架构师、Microsoft的软件架构师。这次演讲是&lt;a href="http://cppandbeyond.com/" target="_blank"&gt;C++ and Beyond 2011&lt;/a&gt;上的一次公开演讲。&lt;/p&gt; &lt;p&gt;陈皓在文中摘取了本次演讲的幻灯片，并做了一些注释和内容提要。 他首先指出：&lt;/p&gt; &lt;blockquote style='border:2px solid #EFEFEF;color:#333333;padding:5px 10px;'&gt; &lt;p&gt;为什么C++？因为 Performance per $，也就是说performance 就是钱，这个分成三个方面，&lt;/p&gt; &lt;ul&gt;&lt;li&gt;耗电，芯片的耗电量，移动设备的耗电量，家用电脑的耗电量都和钱有关系。&lt;/li&gt;&lt;li&gt;资源，家用电脑和移动设备上的处理器资源有限，因为要让一般消费者买的起。&lt;/li&gt;&lt;li&gt;体验，在更小的设备上会有更好的体验，有更好的体验就可以挣更多的钱。&lt;/li&gt;&lt;/ul&gt; &lt;/blockquote&gt; &lt;p&gt;此后，他也回顾了C++的历史，并借助幻灯片中的一张表格指出：&lt;/p&gt; &lt;blockquote style='border:2px solid #EFEFEF;color:#333333;padding:5px 10px;'&gt;如果把我们的对编程语言的需求总结为四个：&lt;strong&gt;效率，灵活，抽象，生产率&lt;/strong&gt;。那么，C语言玩的是前两个，而C++玩的是前三个，Java和C#玩的是后两个（抽象和生产率）&lt;br /&gt; &lt;br /&gt; 任保一种设计都不可能让你什么都要的，这就是Trade-Off&amp;#8212;&amp;#8212;什么事都需要交换的。&lt;/blockquote&gt; &lt;p&gt;接下来，陈皓从移动设备、数据中心两个角度，说明了C++的性能效率的重要性，同时还指出：&lt;/p&gt; &lt;blockquote style='border:2px solid #EFEFEF;color:#333333;padding:5px 10px;'&gt; &lt;p&gt;当然，不是C++不注重 开发效率，看看C++0X的标准引入了多少东西我们就知道了。但是本质上，&lt;strong&gt;C++还是致力于性能和抽象的完全平衡&lt;/strong&gt;。&lt;/p&gt; &lt;/blockquote&gt; &lt;p&gt;目前仍在进行的&lt;a href="http://www.diaochapai.com/survey/586810e4-74e9-4998-aafa-974ca5aaabfa"&gt;2011 InfoQ读者年度深度调查&lt;/a&gt;中，有超过30%参与调查的读者主要使用的语言是C和C++，也欢迎正在阅读本文的您&lt;a href="http://www.diaochapai.com/survey/586810e4-74e9-4998-aafa-974ca5aaabfa"&gt;参与调查&lt;/a&gt;，告诉我们您使用哪些语言，同时也可以在文后留下您对本次讨论的想法。&lt;/p&gt;&lt;/div&gt;&lt;img src="http://www.cnblogs.com/shihao/aggbug/2346136.html?type=1" width="1" height="1" alt=""/&gt;&lt;p&gt;&lt;a href="http://www.cnblogs.com/shihao/archive/2012/02/10/2346136.html" target="_blank"&gt;本文链接&lt;/a&gt;&lt;/p&gt;</content></entry><entry><id>http://www.cnblogs.com/shihao/archive/2012/02/10/2346094.html</id><title type="text">Spring AMQP 1.0 GA发布了</title><summary type="text">近日，SpringSource（VMware下的一个部门）发布了Spring AMQP 1.0 GA（1.0.0.RELEASE）。Spring AMQP项目将Spring核心概念应用到了基于AMQP的消息解决方案的开发上，并且提供了Java与.NET两个版本。要想了解Spring AMQP与AMQP，请阅读文章“Introduction to SpringSource&amp;#39;s Advanced Message Queuing Protocol Support”。 Spring AMQP提供了org.springframework.amqp.core.AmqpTemplate来发送与接收消</summary><published>2012-02-10T12:56:00Z</published><updated>2012-02-10T12:56:00Z</updated><author><name>ChaunceyHao</name><uri>http://www.cnblogs.com/shihao/</uri></author><link rel="alternate" href="http://www.cnblogs.com/shihao/archive/2012/02/10/2346094.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/shihao/archive/2012/02/10/2346094.html"/><content type="html">&lt;div&gt;&lt;p&gt;近日，SpringSource（VMware下的一个部门）&lt;a href="http://www.springsource.org/node/3219"&gt;发布&lt;/a&gt;了&lt;a href="http://www.springsource.org/spring-amqp"&gt;Spring AMQP&lt;/a&gt; 1.0 GA（1.0.0.RELEASE）。Spring AMQP项目将Spring核心概念应用到了基于AMQP的消息解决方案的开发上，并且提供了Java与.NET两个版本。要想了解Spring AMQP与AMQP，请阅读文章&amp;#8220;&lt;a href="http://www.infoq.com/articles/spring_amqp"&gt;Introduction to SpringSource's Advanced Message Queuing Protocol Support&lt;/a&gt;&amp;#8221;。&lt;/p&gt; &lt;p&gt;Spring  AMQP提供了org.springframework.amqp.core.AmqpTemplate来发送与接收消息。AMQP模板实现支持发送与接 收POJOs而非javax.jms.Message实例。他们还提供了一种方式来自定义用于编排对象的MessageConverter。Spring 与JMS用户会发现JmsTemplate与新的AmqpTemplate之间的相似性。&lt;/p&gt; &lt;p&gt;下面的代码片段介绍了如何联合使用Spring AMQP与RabbitMQ处理同步消息。&lt;a href="http://www.rabbitmq.com/server.html"&gt;RabbitMQ&lt;/a&gt;是VMware的产品，并且是官方Spring AMQP示例中所用的默认AMQP实现。&lt;/p&gt; &lt;pre&gt;&amp;lt;beans xmlns="http://www.springframework.org/schema/beans" 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 	xmlns:rabbit="http://www.springframework.org/schema/rabbit" 	xsi:schemaLocation="http://www.springframework.org/schema/rabbit 		http://www.springframework.org/schema/rabbit/spring-rabbit-1.0.xsd 		http://www.springframework.org/schema/beans 		http://www.springframework.org/schema/beans/spring-beans-3.0.xsd"&amp;gt;  	&amp;lt;rabbit:connection-factory id="connectionFactory"/&amp;gt; 	&amp;lt;rabbit:template id="amqpTemplate" connection-factory="connectionFactory"/&amp;gt; 	&amp;lt;rabbit:admin connection-factory="connectionFactory"/&amp;gt; 	&amp;lt;rabbit:queue name="helloworld.queue"/&amp;gt; &amp;lt;/beans&amp;gt; &lt;/pre&gt; &lt;p&gt;上述Spring配置xml引用了ConnectionFactory，创建了一个RabbitTemplate来访问消息broker，创建了一个RabbitAdmin来管理交换、查询与绑定，最后创建了队列。下面的Java代码片段用于发送与接收消息。&lt;/p&gt; &lt;pre&gt;Producer.java  import org.springframework.amqp.core.AmqpTemplate; ...  AmqpTemplate amqpTemplate = context.getBean(AmqpTemplate.class); amqpTemplate.convertAndSend("helloworld.queue", "Hello World"); &lt;/pre&gt;&lt;br /&gt; &lt;pre&gt;Consumer.java  import org.springframework.amqp.core.AmqpTemplate; ...  AmqpTemplate amqpTemplate = context.getBean(AmqpTemplate.class); System.out.println(amqpTemplate.receiveAndConvert("helloworld.queue")); &lt;/pre&gt; &lt;p&gt;要想上手，请下载&lt;a href="http://www.springsource.com/download/community?project=Spring%20AMQP"&gt;Spring AMQP for Java&lt;/a&gt;或是&lt;a href="http://www.springsource.com/download/community?project=Spring%20AMQP.NET"&gt;Spring AMQP for .NET&lt;/a&gt;。Spring  AMQP for Java artifacts也位于SpringSource Maven仓库与Maven  Central中。其依赖是spring-amqp、spring-core与spring-context。如果消息broker使用的是 RabbitMQ，那么还要引入spring-rabbit。你还可以试一下位于GitHub上的&lt;a href="https://github.com/SpringSource/spring-amqp-samples"&gt;Spring AMQP示例&lt;/a&gt;。这些示例都是基于Maven的项目，需要用到RabbitMQ与&lt;a href="http://www.erlang.org/download.html"&gt;Erlang&lt;/a&gt;。请阅读与示例代码一同发布的readme.md文件以了解完整的构建命令。&lt;/p&gt; &lt;p&gt;对于Cloud Foundry用户来说，VMware还&lt;a href="http://blog.cloudfoundry.com/post/8713844574/rabbitmq-cloud-foundry-cloud-messaging-that-just-works"&gt;发布&lt;/a&gt;了RabbitMQ on Cloud Foundry免费的公开Beta版。你可以使用AMQP连接RabbitMQ on Cloud Foundry，通过这些&lt;a href="https://github.com/rabbitmq/rabbitmq-cloudfoundry-samples/tree/master/spring"&gt;示例&lt;/a&gt;可以帮助你快速上手。对于Spring Integration用户来说，版本2.1 M1提供了AMQP支持。&lt;/p&gt; &lt;p&gt;除了VMware的RabbitMQ外，其他基于AMQP面向消息的中间件还有&lt;a href="http://qpid.apache.org/"&gt;Apache Qpid&lt;/a&gt;、&lt;a href="http://www.redhat.com/mrg/"&gt;Red Hat Enterprise MRG&lt;/a&gt;与&lt;a href="http://stormmq.com/"&gt;StormMQ&lt;/a&gt;（托管）。iMatrix的&lt;a href="http://www.openamq.org/"&gt;OpenAMQ&lt;/a&gt;已经不再支持了，因此也没有成为一个选择。&lt;/p&gt; &lt;p&gt;要想了解关于Spring AMQP的更多信息，请查看&lt;a href="http://static.springsource.org/spring-amqp/reference/html/"&gt;Spring AMQP Reference for Java&lt;/a&gt;与&lt;a href="http://static.springsource.org/spring-amqp-net/docs/1.0.x/reference/html/"&gt;Spring AMQP Reference for .NET&lt;/a&gt;参考页面。&lt;/p&gt; &lt;p&gt;&lt;strong&gt;查看英文原文：&lt;/strong&gt;&lt;a href="http://www.infoq.com/news/2011/09/spring-amqp-1.0-ga"&gt;Spring AMQP 1.0 GA&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;&lt;img src="http://www.cnblogs.com/shihao/aggbug/2346094.html?type=1" width="1" height="1" alt=""/&gt;&lt;p&gt;&lt;a href="http://www.cnblogs.com/shihao/archive/2012/02/10/2346094.html" target="_blank"&gt;本文链接&lt;/a&gt;&lt;/p&gt;</content></entry><entry><id>http://www.cnblogs.com/shihao/archive/2012/02/10/2346093.html</id><title type="text">Android 4.0通过新的特性统一了平板电脑与手机</title><summary type="text">Android 4.0可以运行在平板电脑与手机上，并且提供了一些针对UI、通信、共享、媒体、连接、输入类型与企业的新特性。 Google于2011年2月发布了Android 3.0（Honeycomb），但该版本只面向平板电脑，提供了新的“全息”用户界面，这并不适合于智能电话等小屏幕。但Google说他们将会发布新版的移动OS，可以运行在平板电脑与智能电话上。于AsiaD发布的Android 4.0（Ice Cream Sandwich）证实了这一点，来自三星的Galaxy Nexus使用了它，这款手机很快就会面世。 Android 4.0包含的UI widgets与APIs在使用了Andro</summary><published>2012-02-10T12:55:00Z</published><updated>2012-02-10T12:55:00Z</updated><author><name>ChaunceyHao</name><uri>http://www.cnblogs.com/shihao/</uri></author><link rel="alternate" href="http://www.cnblogs.com/shihao/archive/2012/02/10/2346093.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/shihao/archive/2012/02/10/2346093.html"/><content type="html">&lt;div&gt;&lt;p&gt;&lt;a href="http://android-developers.blogspot.com/2011/10/android-40-platform-and-updated-sdk.html"&gt;Android 4.0&lt;/a&gt;可以运行在平板电脑与手机上，并且提供了一些针对UI、通信、共享、媒体、连接、输入类型与企业的新特性。&lt;/p&gt; &lt;p&gt;Google于2011年2月发布了&lt;a href="http://www.infoq.com/news/2011/01/Android-3-Honeycomb"&gt;Android 3.0&lt;/a&gt;（Honeycomb），但该版本只面向平板电脑，提供了新的&amp;#8220;全息&amp;#8221;用户界面，这并不适合于智能电话等小屏幕。但Google说他们将会发布新版的移动OS，可以运行在平板电脑与智能电话上。于&lt;a href="http://allthingsd.com/conferences/asiad/about/"&gt;AsiaD&lt;/a&gt;发布的Android 4.0（Ice Cream Sandwich）证实了这一点，来自三星的&lt;a href="http://www.google.com/nexus/"&gt;Galaxy Nexus&lt;/a&gt;使用了它，这款手机很快就会面世。&lt;/p&gt; &lt;p&gt;Android 4.0包含的UI widgets与APIs在使用了Android 3.x的平板电脑中已经提供了：&lt;/p&gt; &lt;ul&gt;&lt;li&gt;&lt;strong&gt;UI：&lt;/strong&gt;Fragments与内容加载器、动作栏、可缩放的主屏幕widgets、丰富的通知、多点选择拖拽剪贴板&lt;/li&gt;&lt;li&gt;&lt;strong&gt;图形与动画：&lt;/strong&gt;硬件加速的2D图形、基于属性的动画、3D图形&lt;/li&gt;&lt;li&gt;&lt;strong&gt;通信：&lt;/strong&gt;HTTP实时流、支持蓝牙&lt;a href="http://en.wikipedia.org/wiki/A2DP#Advanced_Audio_Distribution_Profile_.28A2DP.29"&gt;A2DP&lt;/a&gt;与&lt;a href="http://en.wikipedia.org/wiki/A2DP#Headset_Profile_.28HSP.29"&gt;HSP&lt;/a&gt;设备、支持&lt;a href="http://developer.android.com/reference/android/net/rtp/package-summary.html"&gt;RTP&lt;/a&gt;（Real-time Transport Protocol）、&lt;a href="http://developer.android.com/reference/android/mtp/package-summary.html"&gt;MTP/PTP&lt;/a&gt;（Media/Photo Transfer Protocol）与&lt;a href="http://en.wikipedia.org/wiki/Digital_rights_management"&gt;DRM&lt;/a&gt;（Digital Rights Management），可以接收来自于键盘、鼠标、游戏手柄与摇杆的输入&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;Ice Cream Sandwich增加了一些新特性与APIs，如下所示。&lt;/p&gt; &lt;p&gt;&lt;strong&gt;UI。&lt;/strong&gt;增加了新的GridLayout以实现更快的布局与渲染。通过TextureView，你可以像一般对象那样操纵OpenGL   ES渲染，该特性非常适合于相机预览、视频解码与游戏场景等。现在可以硬件加速2D绘制了，这样就能以更加吸引人的方式对文本施加缩放、旋转或是其他变换 了。&lt;/p&gt; &lt;p&gt;&lt;strong&gt;通信与共享。&lt;/strong&gt;现在，所有应用都可以共享信息了，可以集成联系人与档案数据，还可以使用Social与Calendar  APIs从网络与日历事件中更新状态。如果应用运行在开启了NFC的电话上，那么你只需触摸屏幕就能通过Android  Beam实现应用间的通信。开发者可以凭借ShareActionProvider widget向应用中添加共享功能。&lt;/p&gt; &lt;p&gt;&lt;strong&gt;媒体。&lt;/strong&gt;添加了一个新的基于&lt;a href="http://www.khronos.org/openmax/al/"&gt;Khronos OpenMAX AL 1.0.1&lt;/a&gt;的API以实现流式多媒体，为流式内容提供了更多的控制。相机支持ZSL曝光、连续对焦、图片缩放，在拍摄视频时能够捕获到全分辨率的快照、还支持人脸识别等功能。&lt;/p&gt; &lt;p&gt;用于转换图片与视频的新媒体效果可运行在GPU上：调整颜色级别与对比度、改变背景、锐化、剪裁、旋转、添加了光学变形等。&lt;/p&gt; &lt;p&gt;支持&lt;a href="http://www.infoq.com/news/2010/10/WebP"&gt;WebP&lt;/a&gt;、VP8、HTTP Live streaming v.3与Matroska容器。&lt;/p&gt; &lt;p&gt;&lt;strong&gt;连接。&lt;/strong&gt;应用可以通过WiFi Direct直接与附近的电话通信而无需使用Internet连接或是热点，支持Bluetooth &lt;a href="http://en.wikipedia.org/wiki/A2DP#Health_Device_Profile_.28HDP.29"&gt;HDP&lt;/a&gt;（Health Device Profile），可以与相应的健康设备与传感器通信。&lt;/p&gt; &lt;p&gt;&lt;strong&gt;输入类型：&lt;/strong&gt;Android 4.0支持新的手写笔输入事件，如压、倾斜与距离轴等。它与手写笔、手指、鼠标等不同，支持多种按钮设备。&lt;/p&gt; &lt;p&gt;&lt;strong&gt;企业。&lt;/strong&gt;可从VPN API获益，与之相关的安全存储与内建的VPN客户端可以访问L2TP与IPsec网络。Device Policy Manager可用于远程控制Android设备，包括在敏感环境下禁用照相机等。&lt;/p&gt; &lt;p&gt;API Level 13（Android 3.2）与14（Android 4.0）之间大约有&lt;a href="http://developer.android.com/sdk/api_diff/14/changes.html"&gt;4%的变化&lt;/a&gt;，14中新增了804处（属性、方法、类等），有370处变更并删除了45处。该&lt;a href="http://developer.android.com/sdk/api_diff/14/changes.html"&gt;API Differences Report&lt;/a&gt;展示了5个新包。&lt;/p&gt; &lt;p&gt;Google更新了&lt;a href="http://developer.android.com/sdk/tools-notes.html"&gt;SDK Tools&lt;/a&gt;（revision 14）、&lt;a href="http://developer.android.com/sdk/compatibility-library.html"&gt;Support Package&lt;/a&gt;（r4）与&lt;a href="http://developer.android.com/sdk/eclipse-adt.html"&gt;ADT plug-in for Eclipse&lt;/a&gt;（r14）以支持Android 4.0 API。&lt;/p&gt; &lt;p&gt;&lt;strong&gt;查看英文原文：&lt;/strong&gt;&lt;a href="http://www.infoq.com/news/2011/10/Android-4-Ice-Cream-Sandwich"&gt;Android 4.0 Unifies Tablets and Phones with New Features&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;&lt;img src="http://www.cnblogs.com/shihao/aggbug/2346093.html?type=1" width="1" height="1" alt=""/&gt;&lt;p&gt;&lt;a href="http://www.cnblogs.com/shihao/archive/2012/02/10/2346093.html" target="_blank"&gt;本文链接&lt;/a&gt;&lt;/p&gt;</content></entry><entry><id>http://www.cnblogs.com/shihao/archive/2012/02/09/2344422.html</id><title type="text">Create a Slide Show Using the AJAX SlideShow and TreeView Controls</title><summary type="text">Introduction Most web-based slide show applications depend on a database for some or all of the storage. This application allows you to show pictures from a directory structure without any underlying database. The application uses an ASP.NET 2.0 TreeView control for file system navigation...</summary><published>2012-02-09T11:17:00Z</published><updated>2012-02-09T11:17:00Z</updated><author><name>ChaunceyHao</name><uri>http://www.cnblogs.com/shihao/</uri></author><link rel="alternate" href="http://www.cnblogs.com/shihao/archive/2012/02/09/2344422.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/shihao/archive/2012/02/09/2344422.html"/><content type="html">&lt;div&gt;&lt;p&gt;Introduction 				&lt;/p&gt;&lt;p&gt;Most web-based slide show applications depend on a database for some or all of the storage. This application allows you to show pictures from a directory structure without any underlying database. The application uses an ASP.NET 2.0 TreeView control for file system navigation and the AJAX 1.0 SlideShow Extender (control) to display the images found in the directory. &lt;/p&gt;&lt;p&gt;Required Software 				         &lt;/p&gt;&lt;div nobullets=""  colright"=""&gt; &lt;ul&gt;&lt;li&gt;&lt;a rel="nofollow" href="http://www.codeguru.com/csharp/.net/net_asp/controls/article.php/c19567#comment_form"&gt;&lt;nobr&gt;Post a comment&lt;/nobr&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a rel="nofollow" href="http://www.codeguru.com/csharp/.net/net_asp/controls/email.php/c19567/Create-a-Slide-Show-Using-the-AJAX-SlideShow-and-TreeView-Controls.htm"&gt;Email Article&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a rel="nofollow" href="http://www.codeguru.com/csharp/.net/net_asp/controls/print.php/c19567/Create-a-Slide-Show-Using-the-AJAX-SlideShow-and-TreeView-Controls.htm"&gt;Print Article&lt;/a&gt;&lt;/li&gt;&lt;li id="toolBoxShareMenu"&gt;     &lt;img alt="" src="http://www.codeguru.com/newimg/images/icon_share.gif" width="16" height="16" /&gt; &lt;a rel="nofollow" href="http://www.codeguru.com/csharp/.net/net_asp/controls/article.php/c19567#"&gt;Share Articles&lt;/a&gt;&lt;img src="http://www.codeguru.com/newimg/images/arrow_down_spblue.gif"  alt="" /&gt;       &lt;/li&gt;&lt;/ul&gt; &lt;/div&gt;      &lt;p&gt;In order to create this application, you need to install Microsoft Visual Studio.  I used Visual Studio 2005 Professional. You also need to download the ASP.NET AJAX Extensions and the AJAX Control ToolKit found at &lt;a href="http://www.asp.net/"&gt;http://www.asp.net&lt;/a&gt;. These are two different installs so make sure to get both.  The version of AJAX you download must be compatible with your version of Visual Studio and .NET Framework. Since I'm using Microsoft Visual Studio 2005 and ASP.NET 2.0, I chose ASP.NET 2.0 AJAX Extensions 1.0. There is only one download for the Control Toolkit. If you are developing from an IIS website, as opposed to a Visual Studio project, make sure the web site is in the correct ASP.NET version. For my application, I choose 2.0. &lt;/p&gt; &lt;p&gt;You may need to build the AJAX extensions or the AJAX Control ToolKit. You will need to remember the location of the build Control Toolkit's binary: AjaxControlToolkit.dll. You will add this library as a reference to your web project. &lt;/p&gt;&lt;p&gt;A Quick Look at the Application  				&lt;/p&gt;&lt;p&gt;The purpose of the application is, given a directory location, load and display any pictures in that directory via the SlideShow. The application is a single visual web page divided into two sections. The left side of the page is the navigation provided by the ASP.NET 2.0 TreeView control tied to the file system. The right side of the page is the Ajax SlideShow found in the Ajax Control Toolkit with some description labels and control buttons below the image. &lt;/p&gt; &lt;p&gt;&lt;img src="http://www.codeguru.com/dbfiles/get_image.php?id=19567&amp;amp;lbl=080214_01_JPG&amp;amp;ds=20100101" alt="" width="500" height="377" /&gt; &lt;/p&gt; &lt;p&gt;The application is based on four main files: Default.aspx, Default.aspx.cs, SlideService.asmx, and Web.Config.  &lt;strong&gt;Default.aspx&lt;/strong&gt; contains the graphical elements and their default values.  &lt;strong&gt;Default.aspx.cs&lt;/strong&gt; is the bulk of the work to control the navigation via the TreeControl, the ClickThrough, the ViewState and QueryString. &lt;strong&gt;SlideShow.asmx&lt;/strong&gt; is the web service that the SlideShow Control relies on.  &lt;strong&gt;Web.Config&lt;/strong&gt; holds all locations and names for the application. &lt;/p&gt; &lt;p&gt;Explanation of TreeView Structure Versus Web and File System 				&lt;/p&gt;&lt;p&gt;The TreeView control displays and provides navigation for a hierarchical structure of data. This can be any hierarchy. Since the TreeView control is remarkable similar to the TreeView show in the file system application of the operating system, it is an obvious choice for navigation of any file system. &lt;/p&gt; &lt;p&gt;The TreeView control in this article's application has several properties in each node to identify the node. The three most useful are the Text, ValuePath, and the Value.  The Text is what displays in the tree, the directory name. For example, "Product Images". The Value is the web location of the location, for example, "/Images/Product/". The ValuePath is the location of the node as required by the TreeView control, for example  "/Images/|/Images/Product/". The pipe character "|" is the PathSeparator. It is important to set the PathSeparator instead of taking the default which is "/".  You can see where the ValuePath of "/Images///Images/Product/" would be easily confusing. When you use the ValuePath to find the node again, the TreeView control will not find the node using the default PathSeparator.  In order to find the directory and it's child directories contained in the directory, the application uses Server.MapPath to change from the web location of "/Images/Product/" to "c:\project\Images\Product". This may seem simple but you need to be able to distinguish between these different address types while debugging. &lt;/p&gt; &lt;p&gt;The SlideShow control, for this application, shows images in the location contained in the ContextKey and is the same value as the TreeView's Value property. If the location of the SlideShow images did not change, it would not be necessary to use the ContextKey. &lt;/p&gt; &lt;table border="1" cellpadding="2" cellspacing="0"&gt; &lt;tbody&gt;&lt;tr&gt; &lt;th&gt;Control&lt;/th&gt; &lt;th&gt;Location Example&lt;/th&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;TreeView.SelectedNode.Text&lt;/td&gt; &lt;td&gt;Product&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;TreeView.SelectedNode.Value&lt;/td&gt;  &lt;td&gt;/Image/Product/&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;TreeView.SelectedNode.ValuePath&lt;/td&gt; &lt;td&gt;/Image/|/Image/Product/&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;SlideShow.ContextKey&lt;/td&gt; &lt;td&gt;/Image/Product/&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt; &lt;p&gt;Introduction to SlideShow Web Service 				&lt;/p&gt;&lt;p&gt;The SlideShow extender on the Default.aspx page relies on SlideService.asmx which returns an array of slides.  This array contains the location, title, and description of the images to show in the slide show. The following XML is a returned Slide array: &lt;/p&gt; &lt;p style="background=#EEEEEE;"&gt;&lt;code&gt; &amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;&lt;br /&gt; &amp;lt;ArrayOfSlide xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  xmlns:xsd="http://www.w3.org/2001/XMLSchema"  xmlns="http://MYDOMAINHERE.com/"&amp;gt;&lt;br /&gt;  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;Slide&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;ImagePath&amp;gt;/images/images_15seconds.jpg&amp;lt;/ImagePath&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;Name&amp;gt; images_15seconds&amp;lt;/Name&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;Description /&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/Slide&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;Slide&amp;gt;&lt;br /&gt;  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;ImagePath&amp;gt;/images/ images_Blue hills.jpg&amp;lt;/ImagePath&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;Name&amp;gt; images_Blue hills&amp;lt;/Name&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;Description /&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/Slide&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;Slide&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;ImagePath&amp;gt;/images/ images_Sunset.jpg&amp;lt;/ImagePath&amp;gt;&lt;br /&gt;  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;Name&amp;gt; images_Sunset&amp;lt;/Name&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;Description /&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/Slide&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;Slide&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;ImagePath&amp;gt;/images/ images_Water lilies.jpg&amp;lt;/ImagePath&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;Name&amp;gt; images_Water lilies&amp;lt;/Name&amp;gt;&lt;br /&gt;  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;Description /&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/Slide&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;Slide&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;ImagePath&amp;gt;/images/ images_Winter.jpg&amp;lt;/ImagePath&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;Name&amp;gt; images_Winter&amp;lt;/Name&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;Description /&amp;gt;&lt;br /&gt;  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/Slide&amp;gt;&lt;br /&gt; &amp;lt;/ArrayOfSlide&amp;gt; &lt;/code&gt;&lt;/p&gt; &lt;p&gt;The &amp;lt;ImagePath&amp;gt; must be a valid value or the SlideShow will not display. The other tags of Name and Description can be empty.  &lt;/p&gt; &lt;p&gt;You will notice that all images supplied with the sample application have the directory name prefixed to the file name such as "images_Bull Hills.jpg" above. This is done on purpose for easy debugging. The images displayed should be prefixed by the TreeView.Value found in the selected node. &lt;/p&gt;  &lt;p&gt;Complexities of the Slide Service 				&lt;/p&gt;&lt;p&gt;The only job your service needs to perform is, given a valid web directory, return a valid Slide array or NULL.  In order to have a robust service, the service needs to: &lt;/p&gt; &lt;ol&gt;&lt;li&gt;check that the web directory exists with Directory.Exists&lt;/li&gt;&lt;li&gt;check that the image extensions are valid for this application by comparing the extension again a list in web.config&lt;/li&gt;&lt;li&gt;return a valid image listed in web.config if no images are found in the directory&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;Create Web Application  				&lt;/p&gt;&lt;p&gt;In Visual Studio, create a new AJAX enabled web application.  &lt;/p&gt; &lt;p&gt;&lt;img src="http://www.codeguru.com/dbfiles/get_image.php?id=19567&amp;amp;lbl=080214_02_GIF&amp;amp;ds=20100101" alt="" width="500" height="358" /&gt; &lt;/p&gt; &lt;p&gt;Add the AjaxControlToolkit.dll to the project as a reference.  &lt;/p&gt;&lt;p&gt;Create SlideService.asmx 				&lt;/p&gt;&lt;p&gt;Add a web service file named SlideService.asmx. Change the supplied "Hello World" function to the following:  &lt;/p&gt; &lt;p style="background=#EEEEEE;"&gt;&lt;code&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[WebMethod]&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;public AjaxControlToolkit.Slide[] GetSlides(String contextKey)&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return null;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;} &lt;/code&gt;&lt;/p&gt; &lt;p&gt;The function name is GetSlides. The parameter is contextKey of type String. You can use contextKey in anyway you want, it is meant to pass information from the calling AJAX control to the web service. In this application, the parameter will be used to supply the directory for the slide show to be fed from. The return parameter is an array of Slides. The AJAX SlideShow control looks for this signature and the signature is case sensitive and exact. Don't try to change any of this syntax or your service not be called. &lt;/p&gt; &lt;p&gt;Add the following keys to Web.Config:  &lt;/p&gt; &lt;p style="background=#EEEEEE;"&gt;&lt;code&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;add key="SlideServiceNoImagesFoundLocation" value="NoImagesFound.jpg"/&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;add key="SlideServiceValidImageExtensions" value="jpg,gif,bmp,ico"/&amp;gt; &lt;/code&gt;&lt;/p&gt;  &lt;p&gt;The first key provides a web location for an image to display in the slide show when no images are found in the directory specified in the contextKey parameter. In this case, the location is the root of the web site. The second parameter is a list of valid extensions in the directory to return in the slide array. &lt;/p&gt; &lt;p&gt;In the above example, I have provided an image titled "NoImagesFound.jpg" which you will find in this articles' download package. The image is displayed as used in the application below: &lt;/p&gt; &lt;p&gt;&lt;img src="http://www.codeguru.com/dbfiles/get_image.php?id=19567&amp;amp;lbl=080214_03_GIF&amp;amp;ds=20100101" alt="" width="500" height="404" /&gt; &lt;/p&gt; &lt;p&gt;The function for NoImagesFound is below and is called from GetSlides(): &lt;/p&gt; &lt;p style="background=#EEEEEE;"&gt;&lt;code&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;private AjaxControlToolkit.Slide[] GetNoImagesFoundDirectory()&lt;br /&gt;  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;AjaxControlToolkit.Slide[] slides = new AjaxControlToolkit.Slide[1];&lt;br /&gt; &lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// get image from web.config and verify it exists on file system&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;_noImagesFoundWebLocation =  System.Configuration.ConfigurationSettings.AppSettings.Get("SlideServiceNoImagesFoundLocation");&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (!File.Exists(Server.MapPath(_noImagesFoundWebLocation)))&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;throw new  Exception("SlideService.asmx::GetNoImagesFoundDirectory -  NoImagesFoundLocation found in web.config does not exist after  server.mappath - " + Server.MapPath(_noImagesFoundWebLocation));&lt;br /&gt;  &lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// create slide from image&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;slides[0] = new  AjaxControlToolkit.Slide(_noImagesFoundWebLocation, "No Images Found:  Please click on another directory", "");&lt;br /&gt; &lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// return slide&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return (slides);&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;} &lt;/code&gt;&lt;/p&gt; &lt;p&gt;This GetNoImagesFoundDirectory  function creates a Slide array of one element. It grabs the image file location from Web.Config then verifies that the file does exist. It then adds the image into the Slide array with the title to indicate that the user should click on another directory.   &lt;/p&gt; &lt;p&gt;Two functions that are called from GetSlides() that are not provided in this article but are provided in the articles' download are IsImage() and GetImageExtensionsFromWebConfig(). &lt;/p&gt; &lt;p&gt;The function for GetSlides() is below: &lt;/p&gt; &lt;p style="background=#EEEEEE;"&gt;&lt;code&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[WebMethod]&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;public AjaxControlToolkit.Slide[] GetSlides(String contextKey)&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// get valid extensions&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;GetImageExtensionsFromWebConfig();&lt;br /&gt;  &lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// contextKey not empty&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (String.IsNullOrEmpty(contextKey))&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return null;&lt;br /&gt; &lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// contextKey in scope&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if ((contextKey.IndexOf("..")&amp;gt;=0))&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return null;&lt;br /&gt;  &lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// verify contextKey directory exists&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;String mapPath = Server.MapPath(contextKey);&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (!Directory.Exists(mapPath))&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;throw new Exception("SlideService.asmx::GetSlides - mapPath does not exist - " + Server.MapPath(mapPath));&lt;br /&gt; &lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// get files in contextKey directory&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;string[] fileNames = System.IO.Directory.GetFiles(mapPath);&lt;br /&gt;  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (fileNames.Length == 0)&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return GetNoImagesFoundDirectory();&lt;br /&gt; &lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// create generic empty list of slides&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;List&amp;lt;AjaxControlToolkit.Slide&amp;gt; list = new List&amp;lt;AjaxControlToolkit.Slide&amp;gt;();&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;String justFileName;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;String displayedFileTitleOnSlider;&lt;br /&gt;  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;String displayedFileDescriptionOnSlider;&lt;br /&gt; &lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;for (int i = 0; i &amp;lt; fileNames.Length; i++)&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if(IsImage(Path.GetExtension(fileNames[i])))&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// get complete filename&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;justFileName = Path.GetFileName(fileNames[i]);&lt;br /&gt;  &lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// get title&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;displayedFileTitleOnSlider = Path.GetFileNameWithoutExtension(fileNames[i]);&lt;br /&gt; &lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// set description to empty&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;displayedFileDescriptionOnSlider = String.Empty;&lt;br /&gt; &lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// add file to list of slides&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;list.Add(new AjaxControlToolkit.Slide(contextKey +  justFileName, displayedFileTitleOnSlider,  displayedFileDescriptionOnSlider));&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return (list.ToArray());&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;} &lt;/code&gt;&lt;/p&gt; &lt;p&gt;This GetSlides() function gets the valid file extensions from Web.Config and validates that contextKey is not empty and is not trying to go outside of the scope of this application for security. Then the application changes the contextKey from its web location to the physical location on disk via Server.MapPath and ensures its existence. Next the function grabs all files in the directory into a string array. If there are no filenames in the string array, the function returns the NoImagesFound image via the GetNoImagesFoundDirectory() function. Then the function creates an empty list of slides via generics. Then the files names are looped, looking for valid extensions. Each file name with a valid extension is added to the slide array. The file name minus the extension is the slide show image title. The slide show image description is empty.  &lt;/p&gt; &lt;p&gt;Add the following class variables: &lt;/p&gt; &lt;p style="background=#EEEEEE;"&gt;&lt;code&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;String _noImagesFoundWebLocation; //path and file of the image containing "No Images Found" text&lt;br /&gt;  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;String _arrayOfImageExtensions; //string of valid image file extensions without "." in the value ex "jpg,gif"&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;String[] _extensionList; //string array of valid image file extensions without "." and with comma removed &lt;/code&gt;&lt;/p&gt; &lt;p&gt;Add the following references: &lt;/p&gt; &lt;p style="background=#EEEEEE;"&gt;&lt;code&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;using System.Web.UI.WebControls;&lt;br /&gt;  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;using System.Diagnostics;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;using System.IO;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;using System.Configuration;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;using System.Collections.Generic; &lt;/code&gt;&lt;/p&gt; &lt;p&gt;Add this to the declarations above the GetSlides function: &lt;/p&gt; &lt;p style="background=#EEEEEE;"&gt;&lt;code&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[System.Web.Script.Services.ScriptService()] &lt;/code&gt;&lt;/p&gt; &lt;p&gt;When you are done, test the service in the browser by calling the web service page directly: SlideService.asmx. &lt;/p&gt;  &lt;p&gt;&lt;img src="http://www.codeguru.com/dbfiles/get_image.php?id=19567&amp;amp;lbl=080214_04_GIF&amp;amp;ds=20100101" alt="" width="500" height="463.72549019608" /&gt;&lt;br /&gt;(&lt;a href="http://www.codeguru.com/dbfiles/get_image.php?id=19567&amp;amp;lbl=080214_04_GIF&amp;amp;ds=20100101" target="_blank" alt=""&gt;Full Size Image&lt;/a&gt;) &lt;/p&gt; &lt;p&gt;Ensure that the results are in the following format: &lt;/p&gt; &lt;p style="background=#EEEEEE;"&gt;&lt;code&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;Slide&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;ImagePath&amp;gt;/images/Blue hills.jpg&amp;lt;/ImagePath&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;Name&amp;gt;Blue hills&amp;lt;/Name&amp;gt;&lt;br /&gt;  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;Description /&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/Slide&amp;gt; &lt;/code&gt;&lt;/p&gt; &lt;p&gt;A Word of Caution 				&lt;/p&gt;&lt;p&gt;Do not move on to the web page until you are sure the slide service is returning the right data in the right format. When you build and test your web page, it will be nice to know that the slide service is not part of any bugs that pop up. The AJAX Slide Service control will not inform you when you are using it wrong or passing it malformed data from the slide service. It just won't work.  &lt;/p&gt;&lt;p&gt;Introduction to TreeView 				&lt;/p&gt;&lt;p&gt;The TreeView control is a standard navigation control provided in System.Web.UI.WebControls namespace. The default start location of the TreeView control is stored in the &lt;strong&gt;TreeViewDefaultStartLocation&lt;/strong&gt; key in the Web.Config. This location is the root of the control. All other nodes are added by crawling through the child directories in code. &lt;/p&gt; &lt;p&gt;We need to add code to: &lt;/p&gt; &lt;ol&gt;&lt;li&gt;given a selected node, pass the node's ValuePath as the contextKey to the web service&lt;/li&gt;&lt;li&gt;given a location off the node passed in by query string, find the  selected node and pass it's ValuePath as the contextKey to the web  service&lt;/li&gt;&lt;/ol&gt; &lt;p&gt;The TreeView control has a concept of a selected node. Each node with children will have a selection icon such as a + sign. This indicates the node has children. Clicking on the plus sign is not "selecting" the node but just navigation through the nodes. Once you click on the name of the directory, you have selected it. The SlideShow will only change images on node selection, not on tree navigation.  &lt;/p&gt; &lt;p&gt;Introduction to the AJAX Slide Show 				&lt;/p&gt;&lt;p&gt;The AJAX Slide Show control is a member of the AJAX control toolkit found in AJAXControlToolkit.dll. It displays images from a location found via a web path. The Slide Show control must know where to find the slide web service. This parameter is stored in the Web.Config in the &lt;strong&gt;SlideShowWebServiceLocation&lt;/strong&gt; key and is a web path and file name. One of the parameters for the control is the location of the slide web service that the slide show uses. This is stored in the Web.Config file in the &lt;strong&gt;SlideShowDefaultLocation&lt;/strong&gt;.  Another parameter is the first file to load. This allows the slide show to display an image while the web service is building the array of slides. This value is stored in the Web.Config in the &lt;strong&gt;SlideShowDefaultLocationFirstPicture&lt;/strong&gt; key. &lt;/p&gt;  &lt;p&gt;If you are using a single directory of images, you can set all the necessary values for the Slide Show in the control's parameters. You do not need to add any script/code. Since this application does change directories, some of the Slide Show parameters will be set in the code behind file.  &lt;/p&gt;&lt;p&gt;Modify Web Page 				&lt;/p&gt;&lt;p&gt;In the default.aspx, add an AJAX Script Manager: &lt;/p&gt; &lt;p style="background=#EEEEEE;"&gt;&lt;code&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;asp:ScriptManager ID="ScriptManager1" runat="server" /&amp;gt;  &lt;/code&gt;&lt;/p&gt; &lt;p&gt;The script manager is provided from the AJAX Extensions library.  &lt;/p&gt; &lt;p&gt;Then add a TreeControl from the navigation tab of the toolbox. Change the default control from: &lt;/p&gt; &lt;p style="background=#EEEEEE;"&gt;&lt;code&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;asp:TreeView ID="TreeView1" runat="server"&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/asp:TreeView&amp;gt; &lt;/code&gt;&lt;/p&gt;  &lt;p&gt;to:  &lt;/p&gt; &lt;p style="background=#EEEEEE;"&gt;&lt;code&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;asp:TreeView ID="TreeView1" runat="server"&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ExpandDepth=1&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ShowExpandCollapse=true&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;OnSelectedNodeChanged="TreeView1_OnSelectedNodeChanged"&lt;br /&gt;  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;PathSeparator="|"&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;EnableViewState=true&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;SelectedNodeStyle-Font-Bold=true&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;SelectedNodeStyle-ForeColor=red&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;/&amp;gt; &lt;/code&gt;&lt;/p&gt; &lt;p&gt;The two most important parameters are the OnSelectedNodeChanged and the PathSeparator. The OnSelectedNodeChanged will call the slide service for a new array of slides to display. The PathSeparator has already been discussed. &lt;/p&gt; &lt;p&gt;Add an Image control which is where the Slide Show will display the images:  &lt;/p&gt; &lt;p style="background=#EEEEEE;"&gt;&lt;code&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;asp:Image ID="imgPhotos" runat="server" Height="300" Style="width:auto; border:solid 1px #000000;" /&amp;gt; &lt;/code&gt;&lt;/p&gt;  &lt;p&gt;Add the SlideShow Extender (control) from the AJAX control toolkit.  Change the default control from: &lt;/p&gt; &lt;p style="background=#EEEEEE;"&gt;&lt;code&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;cc1:SlideShowExtender ID="SlideShowExtender1" runat="server"&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/cc1:SlideShowExtender&amp;gt; &lt;/code&gt;&lt;/p&gt; &lt;p&gt;to: &lt;/p&gt; &lt;p style="background=#EEEEEE;"&gt;&lt;code&gt;  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;cc1:SlideShowExtender ID="SlideShowExtender1" runat="server"&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;TargetControlID="imgPhotos"&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;SlideShowServiceMethod="GetSlides"&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;SlideShowServicePath="/SlideService.asmx"&lt;br /&gt;  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ContextKey="images/"&lt;br /&gt;  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;UseContextKey=true&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;AutoPlay="true"&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;NextButtonID="btnNext"&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;PlayButtonText="Play"&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;StopButtonText="Stop"&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;PreviousButtonID="btnPrev"&lt;br /&gt;  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;PlayButtonID="btnPlay"&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Loop="true"&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ImageTitleLabelID=lblTitle&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ImageDescriptionLabelID=lblDescription&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;/&amp;gt; &lt;/code&gt;&lt;/p&gt; &lt;p&gt;The TargetControlId is where the slide show images will appear. You will also need buttons for Prev, Stop, and Next functionality as well as the Title and Description of the images. In this application, the title is used as the title of the file but the description is used to display the path of the file for debugging purposes. The LabelClickthroughURL is used to be able to test TreeView control navigation from a querystring. An example of this is to send a link to a non-root node via email. &lt;/p&gt; &lt;p&gt;Add the following label controls below the Slide Show: &lt;/p&gt; &lt;p style="background=#EEEEEE;"&gt;&lt;code&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;center&amp;gt;&amp;lt;asp:Label ID="lblTitle" runat=server&amp;gt;&amp;lt;/asp:Label&amp;gt;&amp;lt;/center&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;asp:Label ID="LabelTreeSelectedNode" runat=server&amp;gt;&amp;lt;/asp:Label&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;asp:Label ID="LabelClickthroughURL" runat=server&amp;gt;&amp;lt;/asp:Label&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;asp:Label ID="lblDescription" runat=server&amp;gt;&amp;lt;/asp:Label&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;center&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;asp:Button ID="btnPrev" Text="Prev" runat="server" /&amp;gt;&lt;br /&gt;  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;asp:Button ID="btnPlay" Text="Play" runat="server" /&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;asp:Button ID="btnNext" Text="Next" runat="server" /&amp;gt;&lt;br /&gt;  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/center&amp;gt; &lt;/code&gt;&lt;/p&gt; &lt;p&gt;Default.aspx.cs 				&lt;/p&gt;&lt;p&gt;The main work of the code behind file is to fill the TreeView control, find the correct node, and handle selection of the node. &lt;/p&gt; &lt;p&gt;Add the following library to the default.aspx to handle file and directory management: &lt;/p&gt; &lt;p style="background=#EEEEEE;"&gt;&lt;code&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;using System.IO; &lt;/code&gt;&lt;/p&gt;  &lt;p&gt;The &lt;strong&gt;Page_Load&lt;/strong&gt; function and the &lt;strong&gt;TreeView1_OnSelectedNodeChanged&lt;/strong&gt; function are the two main functions in the default.aspx.cs. The rest of the functions will be lightly discussed here but are supplied in full in this article's download. &lt;/p&gt; &lt;p&gt;The Page_Load function is below: &lt;/p&gt; &lt;p style="background=#EEEEEE;"&gt;&lt;code&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;protected void Page_Load(object sender, EventArgs e)&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;GetWebConfigSettings();&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;VerifyDirectoriesAndFiles();&lt;br /&gt; &lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// SET first image&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;imgPhotos.ImageUrl = _slideShowDefaultLocation + _slideShowDefaultLocationFirstPicture;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;imgPhotos.AlternateText = _slideShowDefaultLocation + _slideShowDefaultLocationFirstPicture;&lt;br /&gt; &lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// set web service path&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;SlideShowExtender1.SlideShowServicePath = _slideShowWebServiceLocation;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;SlideShowExtender1.ContextKey = _slideShowDefaultLocation;&lt;br /&gt;  &lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// don't add copy of tree to tree on postback&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (TreeView1.Nodes.Count == 0)&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;PopulateTree();&lt;br /&gt; &lt;br /&gt; &lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// Set From QueryString or ViewState&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if ((!String.IsNullOrEmpty(_currentTreePathQueryStringName))  &amp;amp;&amp;amp; ((Request[_currentTreePathQueryStringName] != null) ||  (ViewState[_currentTreePathQueryStringName] != null)))&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;SelectNodeBasedOnQueryStringOrViewState();&lt;br /&gt;  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// else assume first time to page&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;else&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// first time to page&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (!String.IsNullOrEmpty(_slideShowDefaultLocation))&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ExpandTreePathByDirPath();&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;  &lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// set labels so that selected info is visible on page&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//LabelTreeSelectedNode.Text = "&amp;lt;b&amp;gt;SlideShowExtender1.ContextKey:&amp;lt;/b&amp;gt;" + SlideShowExtender1.ContextKey;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (String.IsNullOrEmpty(LabelClickthroughURL.Text))&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;LabelClickthroughURL.Text = "&amp;lt;a  href='&amp;#109;&amp;#97;&amp;#105;&amp;#108;&amp;#116;&amp;#111;&amp;#58;&amp;#63;&amp;#115;&amp;#117;&amp;#98;&amp;#106;&amp;#101;&amp;#99;&amp;#116;&amp;#61;&amp;#80;&amp;#105;&amp;#99;&amp;#116;&amp;#117;&amp;#114;&amp;#101;&amp;#32;&amp;#83;&amp;#108;&amp;#105;&amp;#100;&amp;#101;&amp;#83;&amp;#104;&amp;#111;&amp;#119;&amp;#32;&amp;#102;&amp;#114;&amp;#111;&amp;#109;&amp;#32;&amp;#116;&amp;#104;&amp;#101;&amp;#32;&amp;#66;&amp;#101;&amp;#114;&amp;#114;&amp;#121;&amp;#115;&amp;#38;&amp;#97;&amp;#109;&amp;#112;&amp;#59;&amp;#66;&amp;#111;&amp;#100;&amp;#121;&amp;#61;&amp;#34;&amp;#32;&amp;#43;&amp;#32;&amp;#32;&amp;#72;&amp;#116;&amp;#116;&amp;#112;&amp;#67;&amp;#111;&amp;#110;&amp;#116;&amp;#101;&amp;#120;&amp;#116;&amp;#46;&amp;#67;&amp;#117;&amp;#114;&amp;#114;&amp;#101;&amp;#110;&amp;#116;&amp;#46;&amp;#82;&amp;#101;&amp;#113;&amp;#117;&amp;#101;&amp;#115;&amp;#116;&amp;#46;&amp;#85;&amp;#114;&amp;#108;&amp;#32;&amp;#43;&amp;#32;&amp;#34;&amp;#63;&amp;#34;&amp;#32;&amp;#43;&amp;#32;&amp;#95;&amp;#99;&amp;#117;&amp;#114;&amp;#114;&amp;#101;&amp;#110;&amp;#116;&amp;#84;&amp;#114;&amp;#101;&amp;#101;&amp;#80;&amp;#97;&amp;#116;&amp;#104;&amp;#81;&amp;#117;&amp;#101;&amp;#114;&amp;#121;&amp;#83;&amp;#116;&amp;#114;&amp;#105;&amp;#110;&amp;#103;&amp;#78;&amp;#97;&amp;#109;&amp;#101;&amp;#32;&amp;#43;&amp;#32;&amp;#32;&amp;#34;&amp;#61;&amp;#34;&amp;#32;&amp;#43;&amp;#32;&amp;#83;&amp;#101;&amp;#114;&amp;#118;&amp;#101;&amp;#114;&amp;#46;&amp;#85;&amp;#114;&amp;#108;&amp;#69;&amp;#110;&amp;#99;&amp;#111;&amp;#100;&amp;#101;&amp;#40;&amp;#95;&amp;#115;&amp;#108;&amp;#105;&amp;#100;&amp;#101;&amp;#83;&amp;#104;&amp;#111;&amp;#119;&amp;#68;&amp;#101;&amp;#102;&amp;#97;&amp;#117;&amp;#108;&amp;#116;&amp;#76;&amp;#111;&amp;#99;&amp;#97;&amp;#116;&amp;#105;&amp;#111;&amp;#110;&amp;#41;&amp;#32;&amp;#43;&amp;#32;&amp;#34;'&amp;gt;Send link to  this page by email&amp;lt;/a&amp;gt;&amp;lt;br&amp;gt;";&lt;br /&gt;  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;} &lt;/code&gt;&lt;/p&gt; &lt;p&gt;The first two lines get directories and image information from the Web.Config, then verify their existence. The next two lines get the first image for the Slide Show. This is the image that is displayed while the Slide Show service is called and processed. It could be anything from a "please wait&amp;#8230;" image to no image at all. The next line tells the Slide Show where to find the service it is to use to get the list of slides. The next couple of lines populate the TreeView control as long was the TreeView control isn't already populated. This is important for postback. The next section of lines determines which node in the TreeView control should be set as selected (and therefore highlighted in red) based on ViewState or QueryString. This is useful when you want to send the URL to  someone and you want the TreeView to load from an interior node when they click on the link. The last line displays the current context key into a Label on the page for debugging purposes. &lt;/p&gt; &lt;p&gt;The TreeView1_OnSelectedNodeChanged function is below: &lt;/p&gt; &lt;p style="background=#EEEEEE;"&gt;&lt;code&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;protected void TreeView1_OnSelectedNodeChanged(object sender, EventArgs e)&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// DFB: Get Location of Node Selected used by TreeView to find a node&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;_currentTreePath = TreeView1.SelectedNode.ValuePath;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//lblDescription.Text = "&amp;lt;b&amp;gt;Selected ValuePath :&amp;lt;/b&amp;gt;" + _currentTreePath ;&lt;br /&gt; &lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// DFB: Get Location of web Directory&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;SlideShowExtender1.ContextKey = TreeView1.SelectedNode.Value;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//LabelTreeSelectedNode.Text = "&amp;lt;b&amp;gt;SlideShowExtender1.ContextKey:&amp;lt;/b&amp;gt; " + SlideShowExtender1.ContextKey +&lt;br /&gt;  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//    "&amp;lt;br&amp;gt;&amp;lt;b&amp;gt;Server.MapPath(ContextKey)&amp;lt;/b&amp;gt;:" + Server.MapPath(SlideShowExtender1.ContextKey);&lt;br /&gt; &lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// DFB: If Path is not empty, add it to state so we have it on postback&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (!String.IsNullOrEmpty(_currentTreePath))&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ViewState.Add(_currentTreePath, _currentTreePath);&lt;br /&gt;  &lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;LabelClickthroughURL.Text = "&amp;lt;a  href='mailto:?subject=Picture SlideShow from the Berrys&amp;amp;Body=" +  HttpContext.Current.Request.Url + "?" + _currentTreePathQueryStringName +  "=" + Server.UrlEncode(_currentTreePath) + "'&amp;gt;Send link to this page  by email&amp;lt;/a&amp;gt;&amp;lt;br&amp;gt;";&lt;br /&gt;  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;} &lt;/code&gt;&lt;/p&gt; &lt;p&gt;This function is called when the name of a directory is clicked on, not when the expand/contract sign to the left of the name of the directory is clicked on. This selection of the directory name indicates that all valid images (as defined in Web.config) should be found (via the web service) and loaded into the Slide Show control or the "No Image Found" image should be loaded. &lt;/p&gt; &lt;p&gt;The first two lines of the function grab the &lt;strong&gt;ValuePath&lt;/strong&gt; and place it in a label on the page. The next couple of lines get the &lt;strong&gt;Value&lt;/strong&gt; of the directory. This value is the new contextKey for the Slide Service and is placed in a label on the page. The next section of text adds the selected ValuePath to the ViewState and uses it to build a link that you could send someone to get back to this current node's display in the Slide Show.  &lt;/p&gt; &lt;p&gt;Once you have the default.aspx and default.aspx.cs written, make sure you have a working web service and valid values in the Web.Config. &lt;/p&gt; &lt;p&gt;Summary 				&lt;/p&gt;&lt;p&gt;Build your Slide service first and make sure it returns valid information. The function signature is exact, don't change the characters or case. Next build the default.aspx and the code behind page by adding a TreeView for navigation and the AJAX Slide Show for viewing.  &lt;/p&gt;&lt;/div&gt;&lt;img src="http://www.cnblogs.com/shihao/aggbug/2344422.html?type=1" width="1" height="1" alt=""/&gt;&lt;p&gt;&lt;a href="http://www.cnblogs.com/shihao/archive/2012/02/09/2344422.html" target="_blank"&gt;本文链接&lt;/a&gt;&lt;/p&gt;</content></entry><entry><id>http://www.cnblogs.com/shihao/archive/2012/02/09/2344419.html</id><title type="text">DataContractSerializer (C#)</title><summary type="text">using System.Text; 2using System.IO; 3using System.Runtime.Serialization; 4 5 static string Serialize(object obj) 6 { 7 using (MemoryStream memoryStream = new MemoryStream()) 8 using (StreamReader reader = new StreamReader(memoryStream)) 9 { 10 DataContractSerializer serializer = new DataC...</summary><published>2012-02-09T11:14:00Z</published><updated>2012-02-09T11:14:00Z</updated><author><name>ChaunceyHao</name><uri>http://www.cnblogs.com/shihao/</uri></author><link rel="alternate" href="http://www.cnblogs.com/shihao/archive/2012/02/09/2344419.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/shihao/archive/2012/02/09/2344419.html"/><content type="html">&lt;div&gt;&lt;span id="ctl00_cphContentBody_lblCode"&gt;&lt;pre style="font-size: 9pt;"&gt;&lt;pre style="color: #000000"&gt;&lt;span style="color: #0000FF"&gt;using&lt;/span&gt; System.Text; &lt;span style="color: #008284; background-color: #e5e5e5; width: 40px; text-align: right; margin-right: 10px; border-right: 1px solid #999999"&gt;2&lt;/span&gt;&lt;span style="color: #0000FF"&gt;using&lt;/span&gt; System.IO; &lt;span style="color: #008284; background-color: #e5e5e5; width: 40px; text-align: right; margin-right: 10px; border-right: 1px solid #999999"&gt;3&lt;/span&gt;&lt;span style="color: #0000FF"&gt;using&lt;/span&gt; System.Runtime.Serialization; &lt;span style="color: #008284; background-color: #e5e5e5; width: 40px; text-align: right; margin-right: 10px; border-right: 1px solid #999999"&gt;4&lt;/span&gt; &lt;span style="color: #008284; background-color: #e5e5e5; width: 40px; text-align: right; margin-right: 10px; border-right: 1px solid #999999"&gt;5&lt;/span&gt; &lt;span style="color: #0000FF"&gt;static&lt;/span&gt; &lt;span style="color: #0000FF"&gt;string&lt;/span&gt; Serialize(&lt;span style="color: #0000FF"&gt;object&lt;/span&gt; obj) &lt;span style="color: #008284; background-color: #e5e5e5; width: 40px; text-align: right; margin-right: 10px; border-right: 1px solid #999999"&gt;6&lt;/span&gt;		{ &lt;span style="color: #008284; background-color: #e5e5e5; width: 40px; text-align: right; margin-right: 10px; border-right: 1px solid #999999"&gt;7&lt;/span&gt;			&lt;span style="color: #0000FF"&gt;using&lt;/span&gt; (MemoryStream memoryStream = &lt;span style="color: #0000FF"&gt;new&lt;/span&gt; MemoryStream()) &lt;span style="color: #008284; background-color: #e5e5e5; width: 40px; text-align: right; margin-right: 10px; border-right: 1px solid #999999"&gt;8&lt;/span&gt;			&lt;span style="color: #0000FF"&gt;using&lt;/span&gt; (StreamReader reader = &lt;span style="color: #0000FF"&gt;new&lt;/span&gt; StreamReader(memoryStream)) &lt;span style="color: #008284; background-color: #e5e5e5; width: 40px; text-align: right; margin-right: 10px; border-right: 1px solid #999999"&gt;9&lt;/span&gt;			{ &lt;span style="color: #008284; background-color: #e5e5e5; width: 40px; text-align: right; margin-right: 10px; border-right: 1px solid #999999"&gt;10&lt;/span&gt;				DataContractSerializer serializer = &lt;span style="color: #0000FF"&gt;new&lt;/span&gt; DataContractSerializer(obj.GetType()); &lt;span style="color: #008284; background-color: #e5e5e5; width: 40px; text-align: right; margin-right: 10px; border-right: 1px solid #999999"&gt;11&lt;/span&gt;				serializer.WriteObject(memoryStream, obj); &lt;span style="color: #008284; background-color: #e5e5e5; width: 40px; text-align: right; margin-right: 10px; border-right: 1px solid #999999"&gt;12&lt;/span&gt;				memoryStream.Position = 0; &lt;span style="color: #008284; background-color: #e5e5e5; width: 40px; text-align: right; margin-right: 10px; border-right: 1px solid #999999"&gt;13&lt;/span&gt;				&lt;span style="color: #0000FF"&gt;return&lt;/span&gt; reader.ReadToEnd(); &lt;span style="color: #008284; background-color: #e5e5e5; width: 40px; text-align: right; margin-right: 10px; border-right: 1px solid #999999"&gt;14&lt;/span&gt;			} &lt;span style="color: #008284; background-color: #e5e5e5; width: 40px; text-align: right; margin-right: 10px; border-right: 1px solid #999999"&gt;15&lt;/span&gt;		} &lt;span style="color: #008284; background-color: #e5e5e5; width: 40px; text-align: right; margin-right: 10px; border-right: 1px solid #999999"&gt;16&lt;/span&gt; &lt;span style="color: #008284; background-color: #e5e5e5; width: 40px; text-align: right; margin-right: 10px; border-right: 1px solid #999999"&gt;17&lt;/span&gt;		 &lt;span style="color: #0000FF"&gt;static&lt;/span&gt; &lt;span style="color: #0000FF"&gt;object&lt;/span&gt; Deserialize(&lt;span style="color: #0000FF"&gt;string&lt;/span&gt; xml, Type toType) &lt;span style="color: #008284; background-color: #e5e5e5; width: 40px; text-align: right; margin-right: 10px; border-right: 1px solid #999999"&gt;18&lt;/span&gt;		{ &lt;span style="color: #008284; background-color: #e5e5e5; width: 40px; text-align: right; margin-right: 10px; border-right: 1px solid #999999"&gt;19&lt;/span&gt;			&lt;span style="color: #0000FF"&gt;using&lt;/span&gt; (Stream stream = &lt;span style="color: #0000FF"&gt;new&lt;/span&gt; MemoryStream()) &lt;span style="color: #008284; background-color: #e5e5e5; width: 40px; text-align: right; margin-right: 10px; border-right: 1px solid #999999"&gt;20&lt;/span&gt;			{ &lt;span style="color: #008284; background-color: #e5e5e5; width: 40px; text-align: right; margin-right: 10px; border-right: 1px solid #999999"&gt;21&lt;/span&gt;				&lt;span style="color: #0000FF"&gt;byte&lt;/span&gt;[] data = System.Text.Encoding.UTF8.GetBytes(xml); &lt;span style="color: #008284; background-color: #e5e5e5; width: 40px; text-align: right; margin-right: 10px; border-right: 1px solid #999999"&gt;22&lt;/span&gt;				stream.Write(data, 0, data.Length); &lt;span style="color: #008284; background-color: #e5e5e5; width: 40px; text-align: right; margin-right: 10px; border-right: 1px solid #999999"&gt;23&lt;/span&gt;				stream.Position = 0; &lt;span style="color: #008284; background-color: #e5e5e5; width: 40px; text-align: right; margin-right: 10px; border-right: 1px solid #999999"&gt;24&lt;/span&gt;				DataContractSerializer deserializer = &lt;span style="color: #0000FF"&gt;new&lt;/span&gt; DataContractSerializer(toType); &lt;span style="color: #008284; background-color: #e5e5e5; width: 40px; text-align: right; margin-right: 10px; border-right: 1px solid #999999"&gt;25&lt;/span&gt;				&lt;span style="color: #0000FF"&gt;return&lt;/span&gt; deserializer.ReadObject(stream); &lt;span style="color: #008284; background-color: #e5e5e5; width: 40px; text-align: right; margin-right: 10px; border-right: 1px solid #999999"&gt;26&lt;/span&gt;			} &lt;span style="color: #008284; background-color: #e5e5e5; width: 40px; text-align: right; margin-right: 10px; border-right: 1px solid #999999"&gt;27&lt;/span&gt;		}&lt;/pre&gt;&lt;/pre&gt;&lt;/span&gt;&lt;/div&gt;&lt;img src="http://www.cnblogs.com/shihao/aggbug/2344419.html?type=1" width="1" height="1" alt=""/&gt;&lt;p&gt;&lt;a href="http://www.cnblogs.com/shihao/archive/2012/02/09/2344419.html" target="_blank"&gt;本文链接&lt;/a&gt;&lt;/p&gt;</content></entry><entry><id>http://www.cnblogs.com/shihao/archive/2012/02/06/2340085.html</id><title type="text">应用于数据层开发、部署、升级和管理的标准解决方案——数据层应用程序</title><summary type="text">对于普通应用程序的部署和升级，大家已经非常熟悉和习惯的使用MSI或者Click Once了。 那么对于数据层，微软有什么类似的标准而易用的解决方案，可以统一将所需的所有数据库和实例对象（例如，用户表、存储过程、视图、登录等）统一打包，能够 对版本，部署和升级条件及策略的声明和控制呢？这就是数据层应用程序（Data-tier Application，DAC）。 数据层应用程序DAC可使用以下两个工具来实现： 可使用 Microsoft Visual Studio 2010 中的数据层应用程序项目编写和构建 DAC，并可以进行对 T-SQL 代码运行静态代码分析、重构 T-SQL 代码、声明 版本</summary><published>2012-02-06T06:23:00Z</published><updated>2012-02-06T06:23:00Z</updated><author><name>ChaunceyHao</name><uri>http://www.cnblogs.com/shihao/</uri></author><link rel="alternate" href="http://www.cnblogs.com/shihao/archive/2012/02/06/2340085.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/shihao/archive/2012/02/06/2340085.html"/><content type="html">&lt;div&gt;&lt;p&gt;对于普通应用程序的部署和升级，大家已经非常熟悉和习惯的使用&lt;a href="http://msdn.microsoft.com/zh-cn/library/e2444w33.aspx"&gt;MSI&lt;/a&gt;或者&lt;a href="http://msdn.microsoft.com/zh-cn/library/e2444w33.aspx"&gt;Click Once&lt;/a&gt;了。 那么对于数据层，微软有什么类似的标准而易用的解决方案，可以统一将所需的所有数据库和实例对象（例如，用户表、存储过程、视图、登录等）统一打包，能够 对版本，部署和升级条件及策略的声明和控制呢？这就是数据层应用程序（Data-tier Application，DAC）。&lt;/p&gt; &lt;p&gt;数据层应用程序DAC可使用以下两个工具来实现：&lt;/p&gt; &lt;ul&gt;&lt;li&gt;可使用 Microsoft Visual Studio 2010 中的数据层应用程序项目编写和构建 DAC，并可以进行对 T-SQL 代码运行静态代码分析、重构 T-SQL 代码、声明 版本和部署意向的策略；升级DAC时还可以对数据层应用程序进行架构对比。&lt;/li&gt;&lt;li&gt;可以使用 SQL Server Management Studio 中的提取数据层应用程序向导从现有的数据库中提取 DAC，或进行DAC的部署、升级和统一管理。&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;数据层应用程序DAC在软件生命周期中的具体应用：&lt;/p&gt; &lt;ul&gt;&lt;li&gt;开发：Visual Studio 2010 中添加了一些新功能和增强功能： &lt;ul&gt;&lt;li&gt;全面支持数据层应用程序开发。&lt;/li&gt;&lt;li&gt;全新的 Transact-SQL 编辑器体验。&lt;/li&gt;&lt;li&gt;集成式编辑器、调试器、离线和在线 IntelliSense、语言服务和策略设计器。&lt;/li&gt;&lt;li&gt;静态代码分析和构建服务。&lt;/li&gt;&lt;/ul&gt; &lt;/li&gt;&lt;li&gt;部署：引入全新的部署单元DAC包（ DACPAC），从而轻松高效准确地从 Visual Studio 2010 和 SQL Server  Management Studio 部署和升级数据层应用程序。DACPAC是.zip格式的，其中包含.XML和.SQL文件，以方便浏览和对比。&lt;/li&gt;&lt;li&gt;管理：SQL Server 2008 R2 引入了 SQL Server 实用工具控制点（SQL Server  实用工具）的概念，极大地简化了多个 SQL Server 实例的管理。您可以采用 SQL Server 实例并将其注册为现有 SQL  Server  实用工具，从而同时在实例和应用程序级别监控其性能和配置。这有助于您进行趋势分析，从而提高资源利用率并最终降低成本。详细信息及演示，请参考我们的&lt;a href="http://blogs.msdn.com/b/sqlcrd/archive/2010/05/10/sql-server-utility.aspx"&gt;这篇文章&lt;/a&gt;。&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&lt;img src="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-97-59/4431.dac.png" border="0"  alt="" /&gt;&lt;/p&gt;&lt;/div&gt;&lt;img src="http://www.cnblogs.com/shihao/aggbug/2340085.html?type=1" width="1" height="1" alt=""/&gt;&lt;p&gt;&lt;a href="http://www.cnblogs.com/shihao/archive/2012/02/06/2340085.html" target="_blank"&gt;本文链接&lt;/a&gt;&lt;/p&gt;</content></entry><entry><id>http://www.cnblogs.com/shihao/archive/2012/02/06/2340078.html</id><title type="text">深入探索PowerPivot客户端和服务器端架构</title><summary type="text">当用户使用PivotTable连接到在 Excel 外的数据源（External Data Sources）时，Excel用不同的数据源连接器来做连接。其中，当连接到分析服务器时，Excel用了MSOLAP OLE DB Provider来做连接。在MSOLAP OLE DB Provider的连接字符串，我们提供了分析服务器的名字和连接方式（例如：Server Name， Credentials，等等）。MSOLAP Provider 通过TCP传输来与分析服务器沟通。此外，当连接字符串中有HTTP字符时，MSOLAP Provider 将通过HTTP传输来与安装在服务器的数据泵（...</summary><published>2012-02-06T06:20:00Z</published><updated>2012-02-06T06:20:00Z</updated><author><name>ChaunceyHao</name><uri>http://www.cnblogs.com/shihao/</uri></author><link rel="alternate" href="http://www.cnblogs.com/shihao/archive/2012/02/06/2340078.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/shihao/archive/2012/02/06/2340078.html"/><content type="html">&lt;div&gt;&lt;p&gt;当用户使用PivotTable连接到在 Excel 外的数据源（External Data  Sources）时，Excel用不同的数据源连接器来做连接。其中，当连接到分析服务器时，Excel用了MSOLAP OLE DB  Provider来做连接。在MSOLAP OLE DB Provider的连接字符串，我们提供了分析服务器的名字和连接方式（例如：Server  Name， Credentials，等等）。MSOLAP Provider  通过TCP传输来与分析服务器沟通。此外，当连接字符串中有HTTP字符时，MSOLAP Provider  将通过HTTP传输来与安装在服务器的数据泵（data pump）与分析服务器沟通。当连接字符串中指定了部署在Sharepoint  Farm中的Excel文件时，MSOLAP Provider也将用HTTP传输。&lt;/p&gt; &lt;p&gt;介绍了TCP 和HTTP传输后，我们也谈到了一个新的Inproc传输。MSOLAP OLEDB  Provider通过Inproc传输来连接到内存中的PowerPivot引擎。嵌入在Excel工作簿中的PowerPivot  数据在打开文件时被恢复到PowerPivot引擎。客户端的PowerPivot 插件用了熟悉的Analysis Management  Objects（AMO）和ADOMD.Net来对PowerPivot引擎进行查询和操作。&lt;/p&gt; &lt;p&gt;&lt;img src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Components-UserFiles/00-00-12-00-81-Attached+Files/2625.pp01.png" border="0"  alt="" /&gt;&lt;/p&gt; &lt;p&gt;最后，我们谈到了部署在Sharepoint Farm的PowerPivot。我们介绍了在Sharepoint  Farm中的几个PowerPivot的组建。这包括了：PowerPivot Web Service（PWS）和PowerPivot  &amp;nbsp;System Service（PSS）。PowerPivot Web  Service（PWS）是一个在SharePoint前端的薄中间层。PWS 负责把来自Sharepoint  Farm外的请求转发到服务器中的PowerPivot服务程序。我们也谈到了在Sharepoint Farm中，MSOLAP OLEDB  Provider如何用Window Communication Foundation（WCF）为基础的Channel运输来与PowerPivot  &amp;nbsp;System Service（PSS）沟通。&lt;/p&gt; &lt;p&gt;&lt;img src="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-97-59/4428.pp02.png" border="0"  alt="" /&gt;&lt;/p&gt;&lt;/div&gt;&lt;img src="http://www.cnblogs.com/shihao/aggbug/2340078.html?type=1" width="1" height="1" alt=""/&gt;&lt;p&gt;&lt;a href="http://www.cnblogs.com/shihao/archive/2012/02/06/2340078.html" target="_blank"&gt;本文链接&lt;/a&gt;&lt;/p&gt;</content></entry><entry><id>http://www.cnblogs.com/shihao/archive/2012/02/06/2340076.html</id><title type="text">金融与高性能计算的华丽碰撞</title><summary type="text">当金融遇到计算，我们赋予它一个新名词：金融计算。早在20世纪90年代末，纽约、伦敦、日本的诸多金融机构就已经开始了金融计算相关应用，始于1993年全球超级计算机500强排行榜(Top500)中，约450台为国际一流金融机构所用，中国先后已有70多台超级计算机跻身Top 500，但至今仍无一台用于金融领域。 自2008年以来，上海超级计算中心主任的奚自立先 生一直在积极呼吁以打造国际金融中心为目标的上海加紧建设金融计算共同平台，在他看来国外同行早已利用高性能计算创造出一批批金融衍生产品，并演算出未来 走势变化；国内机构还停留在简单计算银行信用卡风险，或是通过随机过程分析计保费。这其间的差距恰如.</summary><published>2012-02-06T06:19:00Z</published><updated>2012-02-06T06:19:00Z</updated><author><name>ChaunceyHao</name><uri>http://www.cnblogs.com/shihao/</uri></author><link rel="alternate" href="http://www.cnblogs.com/shihao/archive/2012/02/06/2340076.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/shihao/archive/2012/02/06/2340076.html"/><content type="html">&lt;div&gt;&lt;span style="font-family: 微软雅黑;" face="微软雅黑"&gt;当金融遇到计算，我们赋予它一个新名词：金融计算。早在&lt;/span&gt;&lt;span style="font-family: 微软雅黑;" face="微软雅黑"&gt;20世纪90年代末，纽约、伦敦、日本的诸多金融机构就已经开始了金融计算相关应用，始于1993年全球超级计算机500强排行榜(Top500)中，约450台为国际一流金融机构所用，中国先后已有70多台超级计算机跻身Top 500，但至今仍无一台用于金融领域。&lt;/span&gt; &lt;p&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-family: 微软雅黑;" face="微软雅黑"&gt;自2008年以来，上海超级计算中心主任的奚自立先 生一直在积极呼吁以打造国际金融中心为目标的上海加紧建设金融计算共同平台，在他看来国外同行早已利用高性能计算创造出一批批金融衍生产品，并演算出未来 走势变化；国内机构还停留在简单计算银行信用卡风险，或是通过随机过程分析计保费。这其间的差距恰如大学生与中学生之间的较量，在全球化势头无法阻挡之 际，我们能做的只有迎头赶上，否则未来的某一天与国外金融机构真正地同台竞技，也许我们会输得倾家荡产。&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-family: 微软雅黑;" face="微软雅黑"&gt;&lt;strong&gt;高性能金融计算应用三场景&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-family: 微软雅黑;" face="微软雅黑"&gt;西方金融机构到底如何利用高性能计算提升其核心竞争力？我先举三个简单例子：&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-family: 微软雅黑;" face="微软雅黑"&gt;&lt;strong&gt;案例一：为金融产品高效定价&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-family: 微软雅黑;" face="微软雅黑"&gt;客户委托金融机构购买期权时，交易员需要快速计算出 期权价格。期权价格的计算是要看所在资产（如股票或其他金融资产）的未来走势，这可能需要对上百万甚至上千万种价格走势路径都计算一边。以往，交易员们都 是在笔记本电脑上用Excel计算，至少需要几分钟的时间。有了高性能计算后，所有路径可以采用并行计算，整体计算时间被缩短到了七秒钟，客户端计算机也 只需16个核，交易员再也不用为需要拖住客户而绞尽脑汁为了。&lt;/span&gt;&lt;/p&gt;   &lt;p&gt;&lt;span style="font-family: 微软雅黑;" face="微软雅黑"&gt;&lt;strong&gt;案例二：更准确评估潜在风险&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-family: 微软雅黑;" face="微软雅黑"&gt;金融计算容易产生的一个误区是，大家都想算出能赚多 少钱，这确实可以算出来，但更重要的是计算投资组合的风险值（value-at-  risk），这不仅是对每个头寸重新定价，还要考虑各种参数的变化，例如金融系数、利率、汇率等因素都可能随时改变，这些变化会是一个巨大的组合，再乘上 金融组合数，所需要的计算量通常需要花一整晚的时间，最后算出来的报告就是回答一个问题：这么多组合在第二天开市后，价值突然缩水到现有５％的可能性有多 大？&lt;/span&gt;&lt;/p&gt;   &lt;p&gt;&lt;span style="font-family: 微软雅黑;" face="微软雅黑"&gt;&lt;strong&gt;案例三：增强快速反应能力，提升程序交易效率&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-family: 微软雅黑;" face="微软雅黑"&gt;当机构投资者买进大量股票时，往往会分拆成一百、几 十股的买，这就要求金融机构的系统能从小小的一百股中发现，哪些来自个人，哪些来自机构，一旦发现有机构出动，就把周围能买到的股票全部买下，然后价格抬 高就出货。要让系统做到如此智能，就必须通过神经元网络进行算法训练，其中的难点在于如何算出不同股票持有人之间的关联，不同公司的资产结构有时很复杂， 只有大规模的计算才能核算出来。&lt;/span&gt;&lt;/p&gt;   &lt;p&gt;&lt;span style="font-family: 微软雅黑;" face="微软雅黑"&gt;&lt;strong&gt;金融计算离不开数据、模型、计算平台和人&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-family: 微软雅黑;" face="微软雅黑"&gt;这四大要素中，数据排第一。金融说到底就是数据。相 比国内金融行业的严重信息不对称，国外的信息完全开放，所有金融衍生品都会明白告诉客户，它们是怎么计算出来的。中国要发展金融计算，首先要解决数据真源 性的问题，然后才能去考虑对数据的分析。谁都知道，针对二十年数据的分析比十年的精确，针对三十年数据的分析比二十年的精确。从现在开始积累我们的真实数 据，亡羊补牢，为时不晚。&lt;/span&gt;&lt;/p&gt;   &lt;p&gt;&lt;span style="font-family: 微软雅黑;" face="微软雅黑"&gt;模型和金融计算平台，不妨借鉴国际上最为主流的模型 和技术。随着高性能计算与云计算的结合，金融服务业或可成为这一领域的主流商业应用。在美国，为各大机构提供风险分析服务的RiskMetrics，已经 将其计算搬到了云计算平台Windows  Azure上，启动初期就已提出6,000个核的需求，是我们之前预期的12倍；为保险业提供精算软件的Milliman，目前也已搬到了Windows  Azure平台上。目前欧洲、日本的发展形势非常喜人，与美国相当。&lt;/span&gt;&lt;/p&gt;   &lt;p&gt;&lt;span style="font-family: 微软雅黑;" face="微软雅黑"&gt;数据、模型、金融计算平台，再加上另一个不可或缺的 因素&amp;#8212;&amp;#8212;人才，我们的金融计算就完整了。中国最缺的就是交叉学科人才，尤其在金融领域。为此，我们日前与摩根士丹利和上海超级计算中心联合举办了&amp;#8220;微软&amp;#8212; 摩根士丹利杯&amp;#8221;2011金融超级计算挑战赛，即国内首个金融与高性能计算的跨学科竞赛。我们希望通过此次竞赛为金融和计算机等专业的同学提供一个学以致用 的平台，也希望以此引起高校、业界和政府部门对高性能金融计算的关注与重视。在为期五天的挑战赛期间，参赛队伍在上海超算中心的曙光5000A超级计算机 平台上，运用Windows HPC Server 2008  R2等软件，根据万得资讯提供的金融产品的真实历史数据，对摩根士丹利提供的多种虚拟金融衍生产品进行建模定价与评估，去解决国际金融交易员、风险管理 员、分析师每天面对的真实问题。&lt;/span&gt;&lt;/p&gt;   &lt;p&gt;&lt;span style="font-family: 微软雅黑;" face="微软雅黑"&gt;曾有一位参赛选手在挑战赛论坛上说到，&amp;#8220;这几天起早 贪黑和高强度的作业，我们理解了更多程序语言的新方法，熟悉了各种期权条款，接触到不少市场股票数据，以及解决问题的基本方法。还有更加体会到市场的无 情。&amp;#8221; 尤其这最后一句话让我颇有感触，正如《冰与火之歌》中所说的那样&amp;#8220;Winter is coming&amp;#8221;，惟有无情的市场才能让我们在磨练中成长。&lt;/span&gt;&lt;/p&gt;   &lt;p&gt;&lt;span style="font-family: 微软雅黑;" face="微软雅黑"&gt;入世十年，中国金融业在规模上取得了长足进步，单论 资产规模，中国银行已经位居世界前列；而下一个&amp;#8220;十年&amp;#8221;，无疑将会面对更加广泛和激烈的国际竞争，中国金融机构如何实现质的飞跃？如何借助高性能计算等尖 端IT技术，帮助以上海为代表的中国城市成为国际金融中心？这些悬念，或许要留待通过此次大赛成长起来的一代人，来为我们解开。&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;img src="http://www.cnblogs.com/shihao/aggbug/2340076.html?type=1" width="1" height="1" alt=""/&gt;&lt;p&gt;&lt;a href="http://www.cnblogs.com/shihao/archive/2012/02/06/2340076.html" target="_blank"&gt;本文链接&lt;/a&gt;&lt;/p&gt;</content></entry><entry><id>http://www.cnblogs.com/shihao/archive/2012/02/06/2340071.html</id><title type="text">利用Contained Database和DAC来开发基于SQL Server &amp;quot;Denali&amp;quot;和SQL Azure之上的应用程序</title><summary type="text">让应用程序的数据层可以在本地SQL Server服务器、私有云、共有云之间方便的部署、移动、升级和管理，正在迅速成为当前云时代的关键技术之一。SQL Server “Denali” 的新增功能——包含的数据库Contained Database (CDB) 和数据层应用DAC正是为了满足这一需求而研发并推出的。这两项技术在一起所提供的功能，将SQL Server应用程序的开发、部署、和不同环境之间的移动完全流程化了，让开发人员和DBA能够淋漓发挥，游刃有余。 进展 亮点简述 包含的数据库Contained Database (CDB)：排序规则和安全认证已经可以内置在CDB中；数据层...</summary><published>2012-02-06T06:16:00Z</published><updated>2012-02-06T06:16:00Z</updated><author><name>ChaunceyHao</name><uri>http://www.cnblogs.com/shihao/</uri></author><link rel="alternate" href="http://www.cnblogs.com/shihao/archive/2012/02/06/2340071.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/shihao/archive/2012/02/06/2340071.html"/><content type="html">&lt;div&gt;&lt;p&gt;让应用程序的数据层可以在本地SQL  Server服务器、私有云、共有云之间方便的部署、移动、升级和管理，正在迅速成为当前云时代的关键技术之一。SQL Server &amp;#8220;Denali&amp;#8221;  的新增功能&amp;#8212;&amp;#8212;包含的数据库Contained Database (CDB)  和数据层应用DAC正是为了满足这一需求而研发并推出的。这两项技术在一起所提供的功能，将SQL  Server应用程序的开发、部署、和不同环境之间的移动完全流程化了，让开发人员和DBA能够淋漓发挥，游刃有余。&lt;/p&gt; &lt;p&gt;&lt;strong&gt;进展&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-97-59/0434.1.png"&gt;&lt;img alt="" src="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-97-59/0434.1.png" border="0" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;亮点简述&lt;/strong&gt;&lt;/p&gt; &lt;ul&gt;&lt;li&gt;包含的数据库Contained Database (CDB)：排序规则和安全认证已经可以内置在CDB中；&lt;/li&gt;&lt;li&gt;数据层应用DAC：BACPAC既包含数据库的元信息，也包含数据；原地升级；可以防止篡改；&lt;/li&gt;&lt;li&gt;代码名为&amp;#8220;Juneau&amp;#8221;的SQL Server开发工具：基于Visual Studio 2010，可以从现有数据库中提取信息新建项目；智能感知（IntelliSense）；可深层验证；版本化build；可声明目标平台，定义服务器选择策略；界面友好直观；&lt;/li&gt;&lt;li&gt;导出导入工具：广泛支持SQL Server 2000（仅支持导出）、2005、2008、2008 R2、SQL Server Denali及SQL Azure。&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-97-59/6746.2.png"&gt;&lt;img alt="" src="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-97-59/6746.2.png" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;&lt;img src="http://www.cnblogs.com/shihao/aggbug/2340071.html?type=1" width="1" height="1" alt=""/&gt;&lt;p&gt;&lt;a href="http://www.cnblogs.com/shihao/archive/2012/02/06/2340071.html" target="_blank"&gt;本文链接&lt;/a&gt;&lt;/p&gt;</content></entry></feed>
