<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Mikel</title>
	<atom:link href="http://www.mikel.cn/feed" rel="self" type="application/rss+xml" />
	<link>http://www.mikel.cn</link>
	<description>专注于C#,Java,ASP.Net,Flash,Flex,SQLServer,Android开发技术的博客</description>
	<lastBuildDate>Fri, 03 Feb 2012 09:16:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>[原创]EasyUI的numberbox取值计算问题</title>
		<link>http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e5%8e%9f%e5%88%9beasyui%e7%9a%84numberbox%e5%8f%96%e5%80%bc%e8%ae%a1%e7%ae%97%e9%97%ae%e9%a2%98.html</link>
		<comments>http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e5%8e%9f%e5%88%9beasyui%e7%9a%84numberbox%e5%8f%96%e5%80%bc%e8%ae%a1%e7%ae%97%e9%97%ae%e9%a2%98.html#comments</comments>
		<pubDate>Fri, 03 Feb 2012 09:16:19 +0000</pubDate>
		<dc:creator>mikel</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[开发笔记]]></category>
		<category><![CDATA[EasyUi]]></category>
		<category><![CDATA[EasyUI的numberbox取值计算问题]]></category>
		<category><![CDATA[numberbox]]></category>
		<category><![CDATA[原创]]></category>

		<guid isPermaLink="false">http://www.mikel.cn/?p=9268</guid>
		<description><![CDATA[今天遇到个比较郁闷的问题， EasyUI的numberbox计算值总也设置不上 代码如下： $('#number,#price').keyup(function(){ $('#total').numberbox('setValue',$('#number').numberbox('getValue')*1*$('#price').numberbox('getValue')*1); }); 只是一个简单的总金额=数量*单价的问题，居然计算不出正确的值，开始以为是keyup事件的写法问题，结果发现原来是numberbox的取值问题，代码修改如下： $('#number,#price').keyup(function(){ $('#total').numberbox('setValue',$('#number').val()*1*$('#price').val()*1); }); 问题解决！ 相关日志[原创]EasyUI1.2.5中Numberbox赋值的问题[原创]EasyUI的Form中fckeditor编辑器不显示编辑的值问题解决办法[原创]EasyUI的treegrid组件动态加载数据问题解决办法[原创]EasyUi的格式化Form表单中的日期显示格式[原创]EasyUI的DataGrid合计汇总页脚使用教程[原创]EasyUI常见问题汇总1：Tab组件的重复ID问题[原创]EasyUI性能优化1：慎用组件的url属性AJAX异步加载数据[原创]EasyUI的TreeGrid查询功能实现[原创]ASP.NET MVC中使用jQuery EasyUI TreeGrid教程[原创]EasyUI的Datagrid组件getFooterRows使用教程]]></description>
			<content:encoded><![CDATA[<p>今天遇到个比较郁闷的问题，<br />
<span class='wp_keywordlink_affiliate'><a href="http://www.mikel.cn/tag/easyui" title="EasyUI" target="_blank">EasyUI</a></span>的<span class='wp_keywordlink_affiliate'><a href="http://www.mikel.cn/tag/numberbox" title="查看 numberbox 的全部文章" target="_blank">numberbox</a></span>计算值总也设置不上<br />
代码如下：</p>
<pre class="brush: jscript;">
$('#number,#price').keyup(function(){
$('#total').<span class='wp_keywordlink_affiliate'><a href="http://www.mikel.cn/tag/numberbox" title="查看 numberbox 的全部文章" target="_blank">numberbox</a></span>('setValue',$('#number').numberbox('getValue')*1*$('#price').numberbox('getValue')*1);
});
</pre>
<p>只是一个简单的总金额=数量*单价的问题，居然计算不出正确的值，开始以为是keyup事件的写法问题，结果发现原来是numberbox的取值问题，代码修改如下：</p>
<pre class="brush: jscript;">
$('#number,#price').keyup(function(){
$('#total').numberbox('setValue',$('#number').val()*1*$('#price').val()*1);
});
</pre>
<p>问题解决！</p>

<a class="dt_button" href="http://www.daitui.com/bookmark?title=%5B%E5%8E%9F%E5%88%9B%5DEasyUI%E7%9A%84numberbox%E5%8F%96%E5%80%BC%E8%AE%A1%E7%AE%97%E9%97%AE%E9%A2%98&amp;link=http%3A%2F%2Fwww.mikel.cn%2F%25e5%25bc%2580%25e5%258f%2591%25e7%25ac%2594%25e8%25ae%25b0%2F%25e5%258e%259f%25e5%2588%259beasyui%25e7%259a%2584numberbox%25e5%258f%2596%25e5%2580%25bc%25e8%25ae%25a1%25e7%25ae%2597%25e9%2597%25ae%25e9%25a2%2598.html&amp;tag=EasyUi%2CEasyUI%E7%9A%84numberbox%E5%8F%96%E5%80%BC%E8%AE%A1%E7%AE%97%E9%97%AE%E9%A2%98%2Cnumberbox%2C%E5%8E%9F%E5%88%9B"><img src="http://src.daitui.com/widget/01.gif" align="absmiddle" alt="收藏与分享" border="0" height="16" width="120" /></a><h2  class="related_post_title">相关日志</h2><ul class="related_post"><li><a href="http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e5%8e%9f%e5%88%9beasyui1-2-5%e4%b8%adnumberbox%e8%b5%8b%e5%80%bc%e7%9a%84%e9%97%ae%e9%a2%98.html" title="[原创]EasyUI1.2.5中Numberbox赋值的问题">[原创]EasyUI1.2.5中Numberbox赋值的问题</a></li><li><a href="http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e5%8e%9f%e5%88%9beasyui%e7%9a%84form%e4%b8%adfckeditor%e7%bc%96%e8%be%91%e5%99%a8%e4%b8%8d%e6%98%be%e7%a4%ba%e7%bc%96%e8%be%91%e7%9a%84%e5%80%bc%e9%97%ae%e9%a2%98%e8%a7%a3%e5%86%b3%e5%8a%9e.html" title="[原创]EasyUI的Form中fckeditor编辑器不显示编辑的值问题解决办法">[原创]EasyUI的Form中fckeditor编辑器不显示编辑的值问题解决办法</a></li><li><a href="http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e5%8e%9f%e5%88%9beasyui%e7%9a%84treegrid%e7%bb%84%e4%bb%b6%e5%8a%a8%e6%80%81%e5%8a%a0%e8%bd%bd%e6%95%b0%e6%8d%ae%e9%97%ae%e9%a2%98%e8%a7%a3%e5%86%b3%e5%8a%9e%e6%b3%95.html" title="[原创]EasyUI的treegrid组件动态加载数据问题解决办法">[原创]EasyUI的treegrid组件动态加载数据问题解决办法</a></li><li><a href="http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e5%8e%9f%e5%88%9beasyui%e7%9a%84%e6%a0%bc%e5%bc%8f%e5%8c%96form%e8%a1%a8%e5%8d%95%e4%b8%ad%e7%9a%84%e6%97%a5%e6%9c%9f%e6%98%be%e7%a4%ba%e6%a0%bc%e5%bc%8f.html" title="[原创]EasyUi的格式化Form表单中的日期显示格式">[原创]EasyUi的格式化Form表单中的日期显示格式</a></li><li><a href="http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e5%8e%9f%e5%88%9beasyui%e7%9a%84datagrid%e5%90%88%e5%87%bb%e6%b1%87%e6%80%bb%e9%a1%b5%e8%84%9a%e4%bd%bf%e7%94%a8%e6%95%99%e7%a8%8b.html" title="[原创]EasyUI的DataGrid合计汇总页脚使用教程">[原创]EasyUI的DataGrid合计汇总页脚使用教程</a></li><li><a href="http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e5%8e%9f%e5%88%9beasyui%e5%b8%b8%e8%a7%81%e9%97%ae%e9%a2%98%e6%b1%87%e6%80%bb1%ef%bc%9atab%e7%bb%84%e4%bb%b6%e7%9a%84%e9%87%8d%e5%a4%8did%e9%97%ae%e9%a2%98.html" title="[原创]EasyUI常见问题汇总1：Tab组件的重复ID问题">[原创]EasyUI常见问题汇总1：Tab组件的重复ID问题</a></li><li><a href="http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e5%8e%9f%e5%88%9beasyui%e6%80%a7%e8%83%bd%e4%bc%98%e5%8c%961%ef%bc%9a%e6%85%8e%e7%94%a8%e7%bb%84%e4%bb%b6%e7%9a%84url%e5%b1%9e%e6%80%a7ajax%e5%bc%82%e6%ad%a5%e5%8a%a0%e8%bd%bd%e6%95%b0%e6%8d%ae.html" title="[原创]EasyUI性能优化1：慎用组件的url属性AJAX异步加载数据">[原创]EasyUI性能优化1：慎用组件的url属性AJAX异步加载数据</a></li><li><a href="http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e5%8e%9f%e5%88%9beasyui%e7%9a%84treegrid%e6%9f%a5%e8%af%a2%e5%8a%9f%e8%83%bd%e5%ae%9e%e7%8e%b0.html" title="[原创]EasyUI的TreeGrid查询功能实现">[原创]EasyUI的TreeGrid查询功能实现</a></li><li><a href="http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e5%8e%9f%e5%88%9basp-net-mvc%e4%b8%ad%e4%bd%bf%e7%94%a8jquery-easyui-treegrid%e6%95%99%e7%a8%8b.html" title="[原创]ASP.NET MVC中使用jQuery EasyUI TreeGrid教程">[原创]ASP.NET MVC中使用jQuery EasyUI TreeGrid教程</a></li><li><a href="http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e5%8e%9f%e5%88%9beasyui%e7%9a%84datagrid%e7%bb%84%e4%bb%b6getfooterrows%e4%bd%bf%e7%94%a8%e6%95%99%e7%a8%8b.html" title="[原创]EasyUI的Datagrid组件getFooterRows使用教程">[原创]EasyUI的Datagrid组件getFooterRows使用教程</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e5%8e%9f%e5%88%9beasyui%e7%9a%84numberbox%e5%8f%96%e5%80%bc%e8%ae%a1%e7%ae%97%e9%97%ae%e9%a2%98.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[转载]Delphi之使用资源文件（Using Resource Files）</title>
		<link>http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bddelphi%e4%b9%8b%e4%bd%bf%e7%94%a8%e8%b5%84%e6%ba%90%e6%96%87%e4%bb%b6%ef%bc%88using-resource-files%ef%bc%89.html</link>
		<comments>http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bddelphi%e4%b9%8b%e4%bd%bf%e7%94%a8%e8%b5%84%e6%ba%90%e6%96%87%e4%bb%b6%ef%bc%88using-resource-files%ef%bc%89.html#comments</comments>
		<pubDate>Fri, 03 Feb 2012 00:19:16 +0000</pubDate>
		<dc:creator>mikel</dc:creator>
				<category><![CDATA[Delphi]]></category>
		<category><![CDATA[开发笔记]]></category>
		<category><![CDATA[Delphi之使用资源文件（Using Resource Files）]]></category>
		<category><![CDATA[资源文件]]></category>

		<guid isPermaLink="false">http://www.mikel.cn/?p=9266</guid>
		<description><![CDATA[[转载]Delphi之使用资源文件（Using Resource Files） &#8211; 瓢虫Monster &#8211; 博客园. New Term 每个Windows应用程序都使用资源。资源（Resources）不是可执行代码，但它属于程序的一部分元素。 典型的Windows程序的资源有： 加速器（Accelerators） 位图（Bitmaps） 光标（Cursors） 对话框（Dialog boxes） 图标（Icons） 菜单（Menus） 数据表（Data tables） 字串表（String tables） 版本信息（Version information） 用户定义的专用资源（User-defined specialty resources）如声音和视频文件 Note 用Project Options对话框的Version Info页面可轻松地将版本信息加到Delphi工程中。如下图： 资源一般包括在扩展名为.rc的资源脚本文件中（resource script file），资源文件就是文本文件。资源文件用资源编译器编译，并在链接时加到应用程序的.exe文件中。 通常大家认为资源要加到可执行文件中，但是有些资源，如位图、字符串表、波形文件，既可以放到外部文件中（.bmp、.txt、.wav），也可加到.exe文件并包含到应用程序文件中。 把资源放到.exe文件中有两条主要优点： 存取资源的速度更快。因为在一个可执行文件中查找资源花的事件比从磁盘文件中装入资源花的时间要少。 程序和资源可一起包含到单个单元（即.exe文件）中，而不需要一大堆的支持文件。 它的不足之处是：会使.exe文件稍稍增大。其大小不会比外部资源文件加可执行文件大。但是增加大小会使加载该程序的时间加长。 是把资源存为外部资源文件，还是把资源放到.exe文件中，这得由编程人员自己定。但要记住的是：这两种方式用哪一种都行（甚至可以在同一个程序中使用两种方式）。 Delphi中的资源（Resources in Delphi） 传统的Windows程序几乎都至少包含一个对话框和一个图标。但是，Delphi应用程序有所不同。首先，Delphi应用程序中没有真正意义上的对话框，实质上也就是没有对话框资源（Delphi中存储的窗体是资源，但它们是RCDATA资源，而不是对话框资源）。 Delphi 应用程序有传统意义的图标资源。创建应用程序时，Delphi负责创建图标资源文件。类似地，在为Speedbutton、Image组件或BitBtn 组件选择位图时，Delphi将所选位图文件包含到窗体资源中（作为窗体资源的一部分）。在建立应用程序时，窗体和它的全部资源一起包括到程序文件中。这 些都是自动处理的。 有时需要在通常的Delphi处理中以外使用资源。例如，要制作动画，必须有一系列的位图，将它们装载进来作为可以最快速度执行的资源。在这种情况下，就需要知道如何把资源捆绑到Delphi应用程序中。 把 资源文件捆绑到可执行文件中是件非常容易的事，实际创建资源却要困难的多。如果有一个好的资源编辑器，创建诸如位图、图标和光标之类的基本资源并不困难， 但创建具有专业化品质的3D位图和图标却是一项艺术性的工作。我们肯定遇到过很多不错的程序，但它们的位图按钮实在难看。我们可以利用Delphi自带的 Image Editor创建位图、图标和光标。 如果要创建字符串资源、用户数据资源、波形文件资源或其他专用资源，则可能需要第三方资源编辑器。 [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.cnblogs.com/pchmonster/archive/2012/02/03/2336450.html">[转载]Delphi之使用资源文件（Using Resource Files） &#8211; 瓢虫Monster &#8211; 博客园</a>.</p>
<div id="cnblogs_post_body">
<blockquote>
<h3><span style="color: #ff0000;">New Term</span></h3>
<p>每个Windows应用程序都使用资源。资源（Resources）不是可执行代码，但它属于程序的一部分元素。</p></blockquote>
<p>典型的Windows程序的资源有：</p>
<ul>
<li>加速器（Accelerators）</li>
<li>位图（Bitmaps）</li>
<li>光标（Cursors）</li>
<li>对话框（Dialog boxes）</li>
<li>图标（Icons）</li>
<li>菜单（Menus）</li>
<li>数据表（Data tables）</li>
<li>字串表（String tables）</li>
<li>版本信息（Version information）</li>
<li>用户定义的专用资源（User-defined specialty resources）如声音和视频文件</li>
</ul>
<blockquote>
<h3><span style="color: #ff0000;">Note</span></h3>
<p>用Project Options对话框的Version Info页面可轻松地将版本信息加到<span class='wp_keywordlink_affiliate'><a href="http://www.mikel.cn/tag/delphi" title="查看 Delphi 的全部文章" target="_blank">Delphi</a></span>工程中。如下图：</p>
<p><a href="http://images.cnblogs.com/cnblogs_com/pchmonster/201202/201202030208465035.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="0246" src="http://images.cnblogs.com/cnblogs_com/pchmonster/201202/20120203020948808.png" border="0" alt="0246" width="434" height="412" /></a></p></blockquote>
<p>资源一般包括在扩展名为.rc的<strong>资源脚本文件</strong>中（resource script file），<span class='wp_keywordlink_affiliate'><a href="http://www.mikel.cn/tag/%e8%b5%84%e6%ba%90%e6%96%87%e4%bb%b6" title="查看 资源文件 的全部文章" target="_blank">资源文件</a></span>就是文本文件。<span class='wp_keywordlink_affiliate'><a href="http://www.mikel.cn/tag/%e8%b5%84%e6%ba%90%e6%96%87%e4%bb%b6" title="查看 资源文件 的全部文章" target="_blank">资源文件</a></span>用资源编译器编译，并在链接时加到应用程序的.exe文件中。</p>
<p>通常大家认为资源要加到可执行文件中，但是有些资源，如位图、字符串表、波形文件，既可以放到外部文件中（.bmp、.txt、.wav），也可加到.exe文件并包含到应用程序文件中。</p>
<p>把资源放到.exe文件中有两条主要优点：</p>
<ul>
<li>存取资源的速度更快。因为在一个可执行文件中查找资源花的事件比从磁盘文件中装入资源花的时间要少。</li>
<li>程序和资源可一起包含到单个单元（即.exe文件）中，而不需要一大堆的支持文件。</li>
</ul>
<p>它的不足之处是：会使.exe文件稍稍增大。其大小不会比外部资源文件加可执行文件大。但是增加大小会使加载该程序的时间加长。</p>
<p>是把资源存为外部资源文件，还是把资源放到.exe文件中，这得由编程人员自己定。但要记住的是：这两种方式用哪一种都行（甚至可以在同一个程序中使用两种方式）。</p>
<h1><span style="color: #9b00d3;"><span class='wp_keywordlink_affiliate'><a href="http://www.mikel.cn/tag/delphi" title="查看 Delphi 的全部文章" target="_blank">Delphi</a></span>中的资源（Resources in Delphi）</span></h1>
<p>传统的Windows程序几乎都至少包含一个对话框和一个图标。但是，Delphi应用程序有所不同。首先，Delphi应用程序中没有真正意义上的对话框，实质上也就是没有对话框资源（Delphi中存储的窗体是资源，但它们是RCDATA资源，而不是对话框资源）。</p>
<p>Delphi 应用程序有传统意义的图标资源。创建应用程序时，Delphi负责创建图标资源文件。类似地，在为Speedbutton、Image组件或BitBtn 组件选择位图时，Delphi将所选位图文件包含到窗体资源中（作为窗体资源的一部分）。在建立应用程序时，窗体和它的全部资源一起包括到程序文件中。这 些都是自动处理的。</p>
<p>有时需要在通常的Delphi处理中以外使用资源。例如，要制作动画，必须有一系列的位图，将它们装载进来作为可以最快速度执行的资源。在这种情况下，就需要知道如何把资源捆绑到Delphi应用程序中。</p>
<p>把 资源文件捆绑到可执行文件中是件非常容易的事，实际创建资源却要困难的多。如果有一个好的资源编辑器，创建诸如位图、图标和光标之类的基本资源并不困难， 但创建具有专业化品质的3D位图和图标却是一项艺术性的工作。我们肯定遇到过很多不错的程序，但它们的位图按钮实在难看。我们可以利用Delphi自带的 Image Editor创建位图、图标和光标。</p>
<p>如果要创建字符串资源、用户数据资源、波形文件资源或其他专用资源，则可能需要第三方资源编辑器。</p>
<blockquote>
<h3><span style="color: #ff0000;">Note</span></h3>
<p>如 果手头有老版本的Borland Pascal，可使用其中的Resource  Workshop编辑器编辑专用资源。创建好资源后，会形成一个.rc文件，Delphi中带有Borland Resource  Compiler，用Borland Resource  Compiler（BRCC32.EXE）将它编译成.res文件。从技术上讲，可以用任何一种文本编辑器创建.rc文件并用资源编译器编译它，但使用资 源编辑器创建资源要容易的多。</p>
<p>现在在推荐一个款比较不错的第三方资源编辑器Resource Builder，该软件界面简洁，使用简单，大家可以百度一下。</p></blockquote>
<h1><span style="color: #9b00d3;">编译资源文件（Compiling Resource Files）</span></h1>
<p>资源文件创建好后，要用资源编译器来编译它。编译资源文件的方法有两种：</p>
<ul>
<li>从命令行手工编译资源文件。</li>
<li>添加一个批处理文件工程到工程组。</li>
</ul>
<p>用其中任意一个方法，编译完后都得到一个.res文件，将它链接到应用程序中。</p>
<h2>1、 从命令行编译（Compiling from the Command Line）</h2>
<p>从命令行编译资源文件，只需打开Windows中的命令提示框，并输入一行与下面相似的命令：</p>
<p><strong>brcc32 jjres.rc</strong></p>
<p><a href="http://images.cnblogs.com/cnblogs_com/pchmonster/201202/201202030209496971.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="0247" src="http://images.cnblogs.com/cnblogs_com/pchmonster/201202/201202030209491497.png" border="0" alt="0247" width="677" height="138" /></a></p>
<p>当然，必须保证当前系统目录为Delphi安装目录的Bin目录下，如果不是，则必须输入BRCC32.EXE的完整路径。这个资源编译器速度非常快，甚至不等察觉，它就把资源脚本文件编译完成了。</p>
<h2>2、 使用批处理文件工程（Using a Batch File Project）</h2>
<p>添加一个批处理文件到工程组，与从命令行编译一样简单，并且还有一个好处：保证资源文件总是最新的。要搞清楚批处理文件如何工作，可执行下面的步骤：</p>
<p>（1）创建一个新的应用程序；</p>
<p>（2）选择【View | Project Manager】打开“Project Manager”工程管理器，如下图：</p>
<p><a href="http://images.cnblogs.com/cnblogs_com/pchmonster/201202/201202030209503515.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="0248" src="http://images.cnblogs.com/cnblogs_com/pchmonster/201202/201202030209517169.png" border="0" alt="0248" width="446" height="236" /></a></p>
<p>（3）点击“Project Manager”工具栏上的“<strong>Add New Project</strong>”按钮，显示Object Repository对象库，如下：</p>
<p><a href="http://images.cnblogs.com/cnblogs_com/pchmonster/201202/201202030209529220.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="0249" src="http://images.cnblogs.com/cnblogs_com/pchmonster/201202/201202030210406290.png" border="0" alt="0249" width="451" height="229" /></a></p>
<p>（4）双击Batch File图标来创建文件工程。将该批处理文件工程以Project2的名称添加到“Project Manager”中，如下：</p>
<p><a href="http://images.cnblogs.com/cnblogs_com/pchmonster/201202/201202030210429519.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="0250" src="http://images.cnblogs.com/cnblogs_com/pchmonster/201202/201202030210424046.png" border="0" alt="0250" width="446" height="236" /></a></p>
<p>（5）用鼠标右键点击批处理文件节点并选择Save，将文件保存为<strong>test.bat</strong>；</p>
<p><a href="http://images.cnblogs.com/cnblogs_com/pchmonster/201202/201202030210433588.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="0251" src="http://images.cnblogs.com/cnblogs_com/pchmonster/201202/20120203021044307.png" border="0" alt="0251" width="473" height="385" /></a></p>
<p>（6）用鼠标右键再次点击批处理文件节点并选择【Edit/Options】，会弹出“Batch File Options”对话框；</p>
<p><a href="http://images.cnblogs.com/cnblogs_com/pchmonster/201202/201202030210456785.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="0252" src="http://images.cnblogs.com/cnblogs_com/pchmonster/201202/201202030210454899.png" border="0" alt="0252" width="447" height="310" /></a></p>
<p>（7）在Command文本框内输入下列正文：</p>
<p><strong>del myfile.res</strong></p>
<p><strong>brcc32 myfile.rc</strong></p>
<p>（8）点击OK关闭“Batch File Options”对话框。</p>
<p>这 个练习锁做的就是创建一个批处理文件，当编译工程组时，它就会执行。第（7）步输入的批处理文件命令删除一个名为myfile.res文件，并调用 Delphi资源编译器编译myfile.rc文件。用资源编译器编译myfile.rc文件会生成一个名为myfile.res的文件。</p>
<p>工 程组中的下一个工程可能要使用myfile.res。呵呵，那为什么要先删除myfile.res文件呢？这是因为，删除该文件后，就能知道资源编译器是 重新建立了这个文件。如果资源编译器创建资源失败，则任何要使用这个资源文件的工程都将编译失败，并报告编译错误，提示编程人员，建立资源文件出错。</p>
<h1><span style="color: #9b00d3;">把资源文件链接到你的可执行文件中（Linking Resource Files to Your Executable）</span></h1>
<p>编译好资源文件后，要把编译后的资源文件链接到程序的可执行文件中，可使用$R编译器指令。例如，要链接包含在myfile.res文件中的二进制资源，可在主窗体单元的开头处插入下面一行：</p>
<div>
<div id="highlighter_451224" class="syntaxhighlighter  pas">
<div class="toolbar"><span><a class="toolbar_item command_help help" href="http://www.cnblogs.com/pchmonster/archive/2012/02/03/2336450.html#">?</a></span></div>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class="gutter">
<div class="line number1 index0 alt2">1</div>
</td>
<td class="code">
<div class="container">
<div class="line number1 index0 alt2"><code class="pas color1">{$R myfile.res}</code></div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<p>就这么简单！只要指定的文件存在，Delphi就会在链接时把这个编译过的资源添加到可执行文件中。</p>
<h1><span style="color: #9b00d3;">使用资源的样本程序（A Sample Program Using Resources）</span></h1>
<p>下面的清单中，列出了Jumping  Jack的程序的主窗体单元。这个程序显示一个带声音效果的简单动画。主窗体上有两个按钮：一个Image组件和一个Label组件。Jumping  Jack程序说说明了资源在Delphi应用程序中的使用。它特别说明了如何加载以资源文件形式存储的位图，如何加载并显示字符串资源，以及如何播放资源 文件中的波形音频。清单后面还列出了部分资源文件。先看看清单，然后再分析程序。</p>
<h3><span style="font-weight: bold; color: #0000ff;"><em>JJMain.pas清单</em></span></h3>
<div>
<div id="highlighter_852274" class="syntaxhighlighter  pas">
<div class="toolbar"><span><a class="toolbar_item command_help help" href="http://www.cnblogs.com/pchmonster/archive/2012/02/03/2336450.html#">?</a></span></div>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class="gutter">
<div class="line number1 index0 alt2">1</div>
<div class="line number2 index1 alt1">2</div>
<div class="line number3 index2 alt2">3</div>
<div class="line number4 index3 alt1">4</div>
<div class="line number5 index4 alt2">5</div>
<div class="line number6 index5 alt1">6</div>
<div class="line number7 index6 alt2">7</div>
<div class="line number8 index7 alt1">8</div>
<div class="line number9 index8 alt2">9</div>
<div class="line number10 index9 alt1">10</div>
<div class="line number11 index10 alt2">11</div>
<div class="line number12 index11 alt1">12</div>
<div class="line number13 index12 alt2">13</div>
<div class="line number14 index13 alt1">14</div>
<div class="line number15 index14 alt2">15</div>
<div class="line number16 index15 alt1">16</div>
<div class="line number17 index16 alt2">17</div>
<div class="line number18 index17 alt1">18</div>
<div class="line number19 index18 alt2">19</div>
<div class="line number20 index19 alt1">20</div>
<div class="line number21 index20 alt2">21</div>
<div class="line number22 index21 alt1">22</div>
<div class="line number23 index22 alt2">23</div>
<div class="line number24 index23 alt1">24</div>
<div class="line number25 index24 alt2">25</div>
<div class="line number26 index25 alt1">26</div>
<div class="line number27 index26 alt2">27</div>
<div class="line number28 index27 alt1">28</div>
<div class="line number29 index28 alt2">29</div>
<div class="line number30 index29 alt1">30</div>
<div class="line number31 index30 alt2">31</div>
<div class="line number32 index31 alt1">32</div>
<div class="line number33 index32 alt2">33</div>
<div class="line number34 index33 alt1">34</div>
<div class="line number35 index34 alt2">35</div>
<div class="line number36 index35 alt1">36</div>
<div class="line number37 index36 alt2">37</div>
<div class="line number38 index37 alt1">38</div>
<div class="line number39 index38 alt2">39</div>
<div class="line number40 index39 alt1">40</div>
<div class="line number41 index40 alt2">41</div>
<div class="line number42 index41 alt1">42</div>
<div class="line number43 index42 alt2">43</div>
<div class="line number44 index43 alt1">44</div>
<div class="line number45 index44 alt2">45</div>
<div class="line number46 index45 alt1">46</div>
<div class="line number47 index46 alt2">47</div>
<div class="line number48 index47 alt1">48</div>
<div class="line number49 index48 alt2">49</div>
<div class="line number50 index49 alt1">50</div>
<div class="line number51 index50 alt2">51</div>
<div class="line number52 index51 alt1">52</div>
<div class="line number53 index52 alt2">53</div>
<div class="line number54 index53 alt1">54</div>
<div class="line number55 index54 alt2">55</div>
<div class="line number56 index55 alt1">56</div>
<div class="line number57 index56 alt2">57</div>
<div class="line number58 index57 alt1">58</div>
<div class="line number59 index58 alt2">59</div>
<div class="line number60 index59 alt1">60</div>
<div class="line number61 index60 alt2">61</div>
<div class="line number62 index61 alt1">62</div>
<div class="line number63 index62 alt2">63</div>
<div class="line number64 index63 alt1">64</div>
<div class="line number65 index64 alt2">65</div>
<div class="line number66 index65 alt1">66</div>
<div class="line number67 index66 alt2">67</div>
<div class="line number68 index67 alt1">68</div>
<div class="line number69 index68 alt2">69</div>
<div class="line number70 index69 alt1">70</div>
<div class="line number71 index70 alt2">71</div>
<div class="line number72 index71 alt1">72</div>
<div class="line number73 index72 alt2">73</div>
<div class="line number74 index73 alt1">74</div>
<div class="line number75 index74 alt2">75</div>
<div class="line number76 index75 alt1">76</div>
<div class="line number77 index76 alt2">77</div>
<div class="line number78 index77 alt1">78</div>
<div class="line number79 index78 alt2">79</div>
<div class="line number80 index79 alt1">80</div>
<div class="line number81 index80 alt2">81</div>
<div class="line number82 index81 alt1">82</div>
<div class="line number83 index82 alt2">83</div>
<div class="line number84 index83 alt1">84</div>
<div class="line number85 index84 alt2">85</div>
<div class="line number86 index85 alt1">86</div>
<div class="line number87 index86 alt2">87</div>
<div class="line number88 index87 alt1">88</div>
<div class="line number89 index88 alt2">89</div>
<div class="line number90 index89 alt1">90</div>
<div class="line number91 index90 alt2">91</div>
<div class="line number92 index91 alt1">92</div>
<div class="line number93 index92 alt2">93</div>
<div class="line number94 index93 alt1">94</div>
<div class="line number95 index94 alt2">95</div>
</td>
<td class="code">
<div class="container">
<div class="line number1 index0 alt2"><code class="pas keyword">unit</code> <code class="pas plain">JmpJackU;</code></div>
<div class="line number2 index1 alt1"></div>
<div class="line number3 index2 alt2"><code class="pas keyword">interface</code></div>
<div class="line number4 index3 alt1"></div>
<div class="line number5 index4 alt2"><code class="pas keyword">uses</code></div>
<div class="line number6 index5 alt1"><code class="pas spaces"> </code><code class="pas plain">Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,</code></div>
<div class="line number7 index6 alt2"><code class="pas spaces"> </code><code class="pas plain">Dialogs, StdCtrls, ExtCtrls, MMSystem;</code></div>
<div class="line number8 index7 alt1"></div>
<div class="line number9 index8 alt2"><code class="pas color1">{$R JJRES.RES}</code></div>
<div class="line number10 index9 alt1"></div>
<div class="line number11 index10 alt2"><code class="pas keyword">const</code></div>
<div class="line number12 index11 alt1"><code class="pas spaces"> </code><code class="pas plain">IDS_UP = </code><code class="pas value">101</code><code class="pas plain">;</code></div>
<div class="line number13 index12 alt2"><code class="pas spaces"> </code><code class="pas plain">IDS_DOWN = </code><code class="pas value">102</code><code class="pas plain">;</code></div>
<div class="line number14 index13 alt1"></div>
<div class="line number15 index14 alt2"><code class="pas keyword">type</code></div>
<div class="line number16 index15 alt1"><code class="pas spaces"> </code><code class="pas plain">TMainForm = </code><code class="pas keyword">class</code><code class="pas plain">(TForm)</code></div>
<div class="line number17 index16 alt2"><code class="pas spaces"> </code><code class="pas plain">Image: TImage;</code></div>
<div class="line number18 index17 alt1"><code class="pas spaces"> </code><code class="pas plain">Label1: TLabel;</code></div>
<div class="line number19 index18 alt2"><code class="pas spaces"> </code><code class="pas plain">Start: TButton;</code></div>
<div class="line number20 index19 alt1"><code class="pas spaces"> </code><code class="pas plain">Stop: TButton;</code></div>
<div class="line number21 index20 alt2"><code class="pas spaces"> </code><code class="pas keyword">procedure</code> <code class="pas plain">FormCreate(Sender: TObject);</code></div>
<div class="line number22 index21 alt1"><code class="pas spaces"> </code><code class="pas keyword">procedure</code> <code class="pas plain">StartClick(Sender: TObject);</code></div>
<div class="line number23 index22 alt2"><code class="pas spaces"> </code><code class="pas keyword">procedure</code> <code class="pas plain">StopClick(Sender: TObject);</code></div>
<div class="line number24 index23 alt1"><code class="pas spaces"> </code><code class="pas keyword">private</code></div>
<div class="line number25 index24 alt2"><code class="pas spaces"> </code><code class="pas comments">{ Private declarations }</code></div>
<div class="line number26 index25 alt1"><code class="pas spaces"> </code><code class="pas plain">Done: </code><code class="pas keyword">Boolean</code><code class="pas plain">;</code></div>
<div class="line number27 index26 alt2"><code class="pas spaces"> </code><code class="pas keyword">procedure</code> <code class="pas plain">DrawImage(</code><code class="pas keyword">var</code> <code class="pas plain">Name: </code><code class="pas keyword">string</code><code class="pas plain">);</code></div>
<div class="line number28 index27 alt1"><code class="pas spaces"> </code><code class="pas keyword">public</code></div>
<div class="line number29 index28 alt2"><code class="pas spaces"> </code><code class="pas comments">{ Public declarations }</code></div>
<div class="line number30 index29 alt1"><code class="pas spaces"> </code><code class="pas keyword">end</code><code class="pas plain">;</code></div>
<div class="line number31 index30 alt2"></div>
<div class="line number32 index31 alt1"><code class="pas keyword">var</code></div>
<div class="line number33 index32 alt2"><code class="pas spaces"> </code><code class="pas plain">MainForm: TMainForm;</code></div>
<div class="line number34 index33 alt1"></div>
<div class="line number35 index34 alt2"><code class="pas keyword">implementation</code></div>
<div class="line number36 index35 alt1"></div>
<div class="line number37 index36 alt2"><code class="pas color1">{$R *.dfm}</code></div>
<div class="line number38 index37 alt1"></div>
<div class="line number39 index38 alt2"><code class="pas keyword">procedure</code> <code class="pas plain">TMainForm</code><code class="pas value">.</code><code class="pas plain">DrawImage(</code><code class="pas keyword">var</code> <code class="pas plain">Name: </code><code class="pas keyword">string</code><code class="pas plain">);</code></div>
<div class="line number40 index39 alt1"><code class="pas keyword">begin</code></div>
<div class="line number41 index40 alt2"><code class="pas spaces"> </code><code class="pas comments">{ 从资源文件中读取位图，通过资源名称}</code></div>
<div class="line number42 index41 alt1"><code class="pas spaces"> </code><code class="pas plain">Image</code><code class="pas value">.</code><code class="pas plain">Picture</code><code class="pas value">.</code><code class="pas plain">Bitmap</code><code class="pas value">.</code><code class="pas plain">LoadFromResourceName(HInstance, Name);</code></div>
<div class="line number43 index42 alt2"><code class="pas spaces"> </code><code class="pas comments">{ 让Image有机会显示位图}</code></div>
<div class="line number44 index43 alt1"><code class="pas spaces"> </code><code class="pas plain">Application</code><code class="pas value">.</code><code class="pas plain">ProcessMessages;</code></div>
<div class="line number45 index44 alt2"><code class="pas spaces"> </code><code class="pas comments">{ 延缓，让动画变慢}</code></div>
<div class="line number46 index45 alt1"><code class="pas spaces"> </code><code class="pas plain">Sleep(</code><code class="pas value">20</code><code class="pas plain">);</code></div>
<div class="line number47 index46 alt2"><code class="pas keyword">end</code><code class="pas plain">;</code></div>
<div class="line number48 index47 alt1"></div>
<div class="line number49 index48 alt2"><code class="pas keyword">procedure</code> <code class="pas plain">TMainForm</code><code class="pas value">.</code><code class="pas plain">FormCreate(Sender: TObject);</code></div>
<div class="line number50 index49 alt1"><code class="pas keyword">begin</code></div>
<div class="line number51 index50 alt2"><code class="pas spaces"> </code><code class="pas plain">Image</code><code class="pas value">.</code><code class="pas plain">Picture</code><code class="pas value">.</code><code class="pas plain">Bitmap</code><code class="pas value">.</code><code class="pas plain">LoadFromResourceName(HInstance, </code><code class="pas string">'ID_BITMAP1'</code><code class="pas plain">);</code></div>
<div class="line number52 index51 alt1"><code class="pas keyword">end</code><code class="pas plain">;</code></div>
<div class="line number53 index52 alt2"></div>
<div class="line number54 index53 alt1"><code class="pas keyword">procedure</code> <code class="pas plain">TMainForm</code><code class="pas value">.</code><code class="pas plain">StartClick(Sender: TObject);</code></div>
<div class="line number55 index54 alt2"><code class="pas keyword">var</code></div>
<div class="line number56 index55 alt1"><code class="pas spaces"> </code><code class="pas plain">s: </code><code class="pas keyword">string</code><code class="pas plain">;</code></div>
<div class="line number57 index56 alt2"><code class="pas spaces"> </code><code class="pas plain">ResName: </code><code class="pas keyword">string</code><code class="pas plain">;</code></div>
<div class="line number58 index57 alt1"><code class="pas spaces"> </code><code class="pas plain">i: </code><code class="pas keyword">Integer</code><code class="pas plain">;</code></div>
<div class="line number59 index58 alt2"><code class="pas spaces"> </code><code class="pas plain">Buff: </code><code class="pas keyword">array</code><code class="pas plain">[</code><code class="pas value">0..9</code><code class="pas plain">] </code><code class="pas keyword">of</code> <code class="pas keyword">Char</code><code class="pas plain">;</code></div>
<div class="line number60 index59 alt1"><code class="pas keyword">begin</code></div>
<div class="line number61 index60 alt2"><code class="pas spaces"> </code><code class="pas plain">s := </code><code class="pas string">'ID_BITMAP'</code><code class="pas plain">;</code></div>
<div class="line number62 index61 alt1"><code class="pas spaces"> </code><code class="pas plain">Done := </code><code class="pas keyword">False</code><code class="pas plain">;</code></div>
<div class="line number63 index62 alt2"><code class="pas spaces"> </code><code class="pas keyword">while</code> <code class="pas keyword">not</code> <code class="pas plain">Done </code><code class="pas keyword">do</code></div>
<div class="line number64 index63 alt1"><code class="pas spaces"> </code><code class="pas keyword">begin</code></div>
<div class="line number65 index64 alt2"><code class="pas spaces"> </code><code class="pas keyword">for</code> <code class="pas plain">i := </code><code class="pas value">1</code> <code class="pas keyword">to</code> <code class="pas value">5</code> <code class="pas keyword">do</code></div>
<div class="line number66 index65 alt1"><code class="pas spaces"> </code><code class="pas keyword">begin</code></div>
<div class="line number67 index66 alt2"><code class="pas spaces"> </code><code class="pas plain">ResName := s + IntToStr(i);</code></div>
<div class="line number68 index67 alt1"><code class="pas spaces"> </code><code class="pas plain">DrawImage(ResName);</code></div>
<div class="line number69 index68 alt2"><code class="pas spaces"> </code><code class="pas keyword">end</code><code class="pas plain">;</code></div>
<div class="line number70 index69 alt1"><code class="pas spaces"> </code><code class="pas plain">LoadString(HInstance, IDS_UP, Buff, SizeOf(Buff));</code></div>
<div class="line number71 index70 alt2"><code class="pas spaces"> </code><code class="pas plain">Label1</code><code class="pas value">.</code><code class="pas plain">Caption := Buff;</code></div>
<div class="line number72 index71 alt1"><code class="pas spaces"> </code><code class="pas plain">Label1</code><code class="pas value">.</code><code class="pas plain">Refresh;</code></div>
<div class="line number73 index72 alt2"><code class="pas spaces"> </code><code class="pas plain">PlaySound(</code><code class="pas string">'ID_WAVEUP'</code><code class="pas plain">, HInstance, SND_ASYNC </code><code class="pas keyword">or</code> <code class="pas plain">SND_RESOURCE);</code></div>
<div class="line number74 index73 alt1"><code class="pas spaces"> </code><code class="pas plain">Sleep(</code><code class="pas value">200</code><code class="pas plain">);</code></div>
<div class="line number75 index74 alt2"><code class="pas spaces"> </code><code class="pas keyword">for</code> <code class="pas plain">i := </code><code class="pas value">5</code> <code class="pas keyword">downto</code> <code class="pas value">1</code> <code class="pas keyword">do</code></div>
<div class="line number76 index75 alt1"><code class="pas spaces"> </code><code class="pas keyword">begin</code></div>
<div class="line number77 index76 alt2"><code class="pas spaces"> </code><code class="pas plain">ResName := s + IntToStr(i);</code></div>
<div class="line number78 index77 alt1"><code class="pas spaces"> </code><code class="pas plain">DrawImage(ResName);</code></div>
<div class="line number79 index78 alt2"><code class="pas spaces"> </code><code class="pas keyword">end</code><code class="pas plain">;</code></div>
<div class="line number80 index79 alt1"><code class="pas spaces"> </code><code class="pas plain">PlaySound(</code><code class="pas string">'ID_WAVEDOWN'</code><code class="pas plain">, HInstance, SND_ASYNC </code><code class="pas keyword">or</code> <code class="pas plain">SND_RESOURCE);</code></div>
<div class="line number81 index80 alt2"><code class="pas spaces"> </code><code class="pas plain">LoadString(HInstance, IDS_DOWN, Buff, SizeOf(Buff));</code></div>
<div class="line number82 index81 alt1"><code class="pas spaces"> </code><code class="pas plain">label1</code><code class="pas value">.</code><code class="pas plain">Caption := Buff;</code></div>
<div class="line number83 index82 alt2"><code class="pas spaces"> </code><code class="pas plain">Label1</code><code class="pas value">.</code><code class="pas plain">Refresh;</code></div>
<div class="line number84 index83 alt1"><code class="pas spaces"> </code><code class="pas plain">Sleep(</code><code class="pas value">200</code><code class="pas plain">);</code></div>
<div class="line number85 index84 alt2"><code class="pas spaces"> </code><code class="pas keyword">end</code><code class="pas plain">;</code></div>
<div class="line number86 index85 alt1"></div>
<div class="line number87 index86 alt2"><code class="pas keyword">end</code><code class="pas plain">;</code></div>
<div class="line number88 index87 alt1"></div>
<div class="line number89 index88 alt2"><code class="pas keyword">procedure</code> <code class="pas plain">TMainForm</code><code class="pas value">.</code><code class="pas plain">StopClick(Sender: TObject);</code></div>
<div class="line number90 index89 alt1"><code class="pas keyword">begin</code></div>
<div class="line number91 index90 alt2"><code class="pas spaces"> </code><code class="pas comments">{ 当“Stop”按钮按下时，告诉循环停止}</code></div>
<div class="line number92 index91 alt1"><code class="pas spaces"> </code><code class="pas plain">Done := </code><code class="pas keyword">True</code><code class="pas plain">;</code></div>
<div class="line number93 index92 alt2"><code class="pas keyword">end</code><code class="pas plain">;</code></div>
<div class="line number94 index93 alt1"></div>
<div class="line number95 index94 alt2"><code class="pas keyword">end</code><code class="pas plain">.</code></div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<h3><span style="color: #0000ff;"><span style="font-weight: bold;"><em>JJRec.rc清单</em></span></span></h3>
<div>
<div id="highlighter_115039" class="syntaxhighlighter  text">
<div class="toolbar"><span><a class="toolbar_item command_help help" href="http://www.cnblogs.com/pchmonster/archive/2012/02/03/2336450.html#">?</a></span></div>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class="gutter">
<div class="line number1 index0 alt2">1</div>
<div class="line number2 index1 alt1">2</div>
<div class="line number3 index2 alt2">3</div>
<div class="line number4 index3 alt1">4</div>
<div class="line number5 index4 alt2">5</div>
<div class="line number6 index5 alt1">6</div>
<div class="line number7 index6 alt2">7</div>
<div class="line number8 index7 alt1">8</div>
<div class="line number9 index8 alt2">9</div>
<div class="line number10 index9 alt1">10</div>
<div class="line number11 index10 alt2">11</div>
<div class="line number12 index11 alt1">12</div>
<div class="line number13 index12 alt2">13</div>
<div class="line number14 index13 alt1">14</div>
<div class="line number15 index14 alt2">15</div>
<div class="line number16 index15 alt1">16</div>
<div class="line number17 index16 alt2">17</div>
<div class="line number18 index17 alt1">18</div>
<div class="line number19 index18 alt2">19</div>
<div class="line number20 index19 alt1">20</div>
<div class="line number21 index20 alt2">21</div>
<div class="line number22 index21 alt1">22</div>
<div class="line number23 index22 alt2">23</div>
<div class="line number24 index23 alt1">24</div>
<div class="line number25 index24 alt2">25</div>
<div class="line number26 index25 alt1">26</div>
</td>
<td class="code">
<div class="container">
<div class="line number1 index0 alt2"><code class="text plain">STRINGTABLE</code></div>
<div class="line number2 index1 alt1"><code class="text plain">BEGIN</code></div>
<div class="line number3 index2 alt2"><code class="text plain">101, "Up"</code></div>
<div class="line number4 index3 alt1"><code class="text plain">102, "Down"</code></div>
<div class="line number5 index4 alt2"><code class="text plain">END</code></div>
<div class="line number6 index5 alt1"></div>
<div class="line number7 index6 alt2"><code class="text plain">ID_WAVEUP WAVE "up.wav"</code></div>
<div class="line number8 index7 alt1"><code class="text plain">ID_WAVEDOWN WAVE "down.wav"</code></div>
<div class="line number9 index8 alt2"></div>
<div class="line number10 index9 alt1"><code class="text plain">ID_BITMAP1 BITMAP</code></div>
<div class="line number11 index10 alt2"><code class="text plain">MOVEABLE PURE LOADONCALL DISCARDABLE</code></div>
<div class="line number12 index11 alt1"><code class="text plain">LANGUAGE LANG_NEUTRAL, 0</code></div>
<div class="line number13 index12 alt2"><code class="text plain">BEGIN</code></div>
<div class="line number14 index13 alt1"><code class="text plain">'42 4D 76 02 00 00 00 00 00 00 76 00 00 00 28 00 '</code></div>
<div class="line number15 index14 alt2"><code class="text plain">'00 00 20 00 00 00 20 00 00 00 01 00 04 00 00 00 '</code></div>
<div class="line number16 index15 alt1"><code class="text plain">'00 00 00 02 00 00 00 00 00 00 00 00 00 00 10 00 '</code></div>
<div class="line number17 index16 alt2"><code class="text plain">'00 00 00 00 00 00 00 00 00 00 00 00 80 00 00 80 '</code></div>
<div class="line number18 index17 alt1"><code class="text plain">'00 00 00 80 80 00 80 00 00 00 80 00 80 00 80 80 '</code></div>
<div class="line number19 index18 alt2"><code class="text plain">'00 00 C0 C0 C0 00 80 80 80 00 00 00 FF 00 00 FF '</code></div>
<div class="line number20 index19 alt1"><code class="text plain">'00 00 00 FF FF 00 FF 00 00 00 FF 00 FF 00 FF FF '</code></div>
<div class="line number21 index20 alt2"><code class="text plain">'00 00 FF FF FF 00 BB BB BB BB BB BB BB BB BB BB '</code></div>
<div class="line number22 index21 alt1"><code class="text plain">'BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB '</code></div>
<div class="line number23 index22 alt2"><code class="text plain">'BB BB BB BB BB BB BB BB BB BB BB BB BB B0 B0 BB '</code></div>
<div class="line number24 index23 alt1"><code class="text plain">'BB BB BB BB BB BB BB BB BB BB BB BB BB B0 B0 BB '</code></div>
<div class="line number25 index24 alt2"></div>
<div class="line number26 index25 alt1"><code class="text plain">此处省略了部分内容，详细内容请查看示例代码</code></div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<h3><span style="color: #0000ff;">分析：</span></h3>
<p>主窗体类声明中声明了一个Done的布尔型字段，Done用于确定何时终止动画。DrawImage方法用于在Image组件中显示位图。</p>
<p>注意：上列代码中，使用了两个Windows API函数来加载字符串和波形文件资源。在StartClick方法中，LoadString函数加载一个字符串到到一个字符数组缓冲区内。然后将该字符数组分配给窗体上的Label组件的Caption属性。</p>
<p>PlaySound函数用于播放波形文件资源。PlaySound函数用SND_ASYNC标志通知Windows开始播放音频并立即将控制返回给 程序，这使得在播放音频的同时，动画能继续下去。SND_RESOURCE标志通知Windows，声音是一个资源，而不是磁盘上的一个文件。 LoadString和PlaySound函数都使用HInstance全局变量通知Windows到可执行文件中去查找资源。装入位图资源，使用VCL 方法LoadFromResourceName。</p>
<p>而资源文件JJRec.rc中的前5行说明字符串在资源脚本文件中的格式；使用文本编辑器创建字符串表非常容易。接下去是为两个波形文件创建各自的 WAVE资源，这两个波形文件已存在该工程目录中。资源编译器一看到WAVE声明，它就会读声音文件并将它们编译进二进制资源文件。</p>
<blockquote>
<h3><span style="color: #ff0000;">Note</span></h3>
<p>从上面的清单中看出，使用文本编辑器来创建某些类型的资源是比较容易的事。如果位图和波形音频文件存为了外部文件，可像上面的清单那样将它们包含到.RC文件中，并用资源编译器将它们编译为二进制资源文件。其中二进制资源文件可链接到应用程序的可执行文件中。</p></blockquote>
<p>上面的资源清单只是部分代码，用传统的资源编辑器创建的位图常常以数字数据的形式包含到资源文件中，位图的资源描述可以很长。Jumping Jack位图资源描述大约有200行，因此未在清单中全部列出。下图给出了Jumping Jack启动后的界面。</p>
<p><a href="http://images.cnblogs.com/cnblogs_com/pchmonster/201202/201202030210473112.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="0253" src="http://images.cnblogs.com/cnblogs_com/pchmonster/201202/201202030210474574.png" border="0" alt="0253" width="312" height="220" /></a></p>
<p>为应用程序创建附加资源不是什么高深的学问，但也不是很简单的事情。要搞清楚它们如何协调配合要花一定的事件。</p>
<p><strong><span style="color: #008000;">以上代码均在Delphi7中测试通过，示例代码下载：</span></strong><a href="http://files.cnblogs.com/pchmonster/JumpingJack.rar"><strong>JumpingJack.rar</strong></a></p>
</div>

<a class="dt_button" href="http://www.daitui.com/bookmark?title=%5B%E8%BD%AC%E8%BD%BD%5DDelphi%E4%B9%8B%E4%BD%BF%E7%94%A8%E8%B5%84%E6%BA%90%E6%96%87%E4%BB%B6%EF%BC%88Using%20Resource%20Files%EF%BC%89&amp;link=http%3A%2F%2Fwww.mikel.cn%2F%25e5%25bc%2580%25e5%258f%2591%25e7%25ac%2594%25e8%25ae%25b0%2F%25e8%25bd%25ac%25e8%25bd%25bddelphi%25e4%25b9%258b%25e4%25bd%25bf%25e7%2594%25a8%25e8%25b5%2584%25e6%25ba%2590%25e6%2596%2587%25e4%25bb%25b6%25ef%25bc%2588using-resource-files%25ef%25bc%2589.html&amp;tag=Delphi%2CDelphi%E4%B9%8B%E4%BD%BF%E7%94%A8%E8%B5%84%E6%BA%90%E6%96%87%E4%BB%B6%EF%BC%88Using%20Resource%20Files%EF%BC%89%2C%E8%B5%84%E6%BA%90%E6%96%87%E4%BB%B6"><img src="http://src.daitui.com/widget/01.gif" align="absmiddle" alt="收藏与分享" border="0" height="16" width="120" /></a><h2  class="related_post_title">相关日志</h2><ul class="related_post"><li><a href="http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bddelphi%e7%bc%96%e8%af%91%e9%93%be%e6%8e%a5%e8%bf%87%e7%a8%8b.html" title="[转载]Delphi编译/链接过程">[转载]Delphi编译/链接过程</a></li><li><a href="http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bd%e6%88%91%e6%89%80%e7%90%86%e8%a7%a3%e7%9a%84delphi%e4%b8%ad%e7%9a%84%e6%95%b0%e7%bb%84%e7%b1%bb%e5%9e%8b.html" title="[转载]我所理解的Delphi中的数组类型">[转载]我所理解的Delphi中的数组类型</a></li><li><a href="http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e5%8e%9f%e5%88%9bdelphi%e6%8a%a5%e8%a1%a8%e5%bc%80%e5%8f%91reportmachine%e7%9a%84%e5%b0%8f%e8%ae%a1%e5%92%8c%e6%80%bb%e8%ae%a1%e7%9a%84%e8%ae%a1%e7%ae%97.html" title="[原创]Delphi报表开发ReportMachine的小计和总计的计算">[原创]Delphi报表开发ReportMachine的小计和总计的计算</a></li><li><a href="http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bddelphi%e7%9a%84idhttp%e7%9a%84%e5%9f%ba%e6%9c%ac%e7%94%a8%e6%b3%95.html" title="[转载]Delphi的IDHTTP的基本用法">[转载]Delphi的IDHTTP的基本用法</a></li><li><a href="http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bdc%e8%b0%83%e7%94%a8dephi%e7%9a%84dll%e4%b9%8b%e8%af%a6%e8%a7%a3-%e5%ae%8c%e6%95%b4%e7%89%88_%e9%99%84%e6%9c%89%e5%8f%af%e4%b8%8b%e8%bd%bddemo.html" title="[转载]C#调用dephi的dll之详解-完整版_附有可下载Demo">[转载]C#调用dephi的dll之详解-完整版_附有可下载Demo</a></li><li><a href="http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bdc%e8%b0%83%e7%94%a8dephi%e7%9a%84dll%e4%b9%8b%e8%af%a6%e8%a7%a3.html" title="[转载]C#调用dephi的dll之详解">[转载]C#调用dephi的dll之详解</a></li><li><a href="http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bd%e7%94%a8delphi%e4%bb%8e%e5%86%85%e5%ad%98%e6%b5%81%e4%b8%ad%e5%88%a4%e6%96%ad%e5%9b%be%e7%89%87%e6%a0%bc%e5%bc%8f.html" title="[转载]用Delphi从内存流中判断图片格式">[转载]用Delphi从内存流中判断图片格式</a></li><li><a href="http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bdwindows-sdk%e7%bc%96%e7%a8%8bdelphi%e7%89%88-%e4%b9%8b-windows%e7%bc%96%e7%a8%8b%e6%a6%82%e8%bf%b0%e4%b8%8e%e6%a1%86%e6%9e%b6.html" title="[转载]Windows SDK编程(Delphi版) 之 Windows编程概述与框架">[转载]Windows SDK编程(Delphi版) 之 Windows编程概述与框架</a></li><li><a href="http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bddelphi-%e7%bb%84%e4%bb%b6%e5%bc%80%e5%8f%91%e6%95%99%e7%a8%8b%e6%8c%87%e5%8d%97%ef%bc%888%ef%bc%89%e5%ae%9a%e5%88%b6%e7%89%b9%e8%89%b2button.html" title="[转载]Delphi 组件开发教程指南（8）定制特色Button">[转载]Delphi 组件开发教程指南（8）定制特色Button</a></li><li><a href="http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e5%8e%9f%e5%88%9basp-net-mvc%e8%b0%83%e7%94%a8delphi%e5%bc%80%e5%8f%91%e7%9a%84web%e6%8a%a5%e8%a1%a8%e6%89%93%e5%8d%b0activex%e7%bb%84%e4%bb%b6.html" title="[原创]ASP.NET MVC调用Delphi开发的Web报表打印activex组件">[原创]ASP.NET MVC调用Delphi开发的Web报表打印activex组件</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bddelphi%e4%b9%8b%e4%bd%bf%e7%94%a8%e8%b5%84%e6%ba%90%e6%96%87%e4%bb%b6%ef%bc%88using-resource-files%ef%bc%89.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[转载]android ORM框架的性能简单测试(androrm vs ormlite)</title>
		<link>http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bdandroid-orm%e6%a1%86%e6%9e%b6%e7%9a%84%e6%80%a7%e8%83%bd%e7%ae%80%e5%8d%95%e6%b5%8b%e8%af%95androrm-vs-ormlite.html</link>
		<comments>http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bdandroid-orm%e6%a1%86%e6%9e%b6%e7%9a%84%e6%80%a7%e8%83%bd%e7%ae%80%e5%8d%95%e6%b5%8b%e8%af%95androrm-vs-ormlite.html#comments</comments>
		<pubDate>Fri, 03 Feb 2012 00:13:50 +0000</pubDate>
		<dc:creator>mikel</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[开发笔记]]></category>
		<category><![CDATA[android ORM框架的性能简单测试(androrm vs ormlite)]]></category>
		<category><![CDATA[ORM]]></category>

		<guid isPermaLink="false">http://www.mikel.cn/?p=9262</guid>
		<description><![CDATA[[转载]android ORM框架的性能简单测试(androrm vs ormlite) &#8211; youxiachai &#8211; 博客园. 前言 看了一下现在的 Android设备,性能都不差,就懒得直接用SQLite,直接上ORM框架把,上网搜了一圈,觉得androrm, ormlite 这两个不错,当然,还有点别的,这里就不多做介绍,竟然说明了是简单测试,而本人,也不算是专业的测试人员,就测试一下这两个框架在同一设备下,插入 1w(本来是想插100w,后来插入10w,接着就只能插1w,呵呵有兴趣的可以去测试一下…)行数据的时间吧,给大家做一个简单参考,真正要做比较的 话,其实,测试,表查询才是最重要的,但是,关键我没有这样的数据源,要构建一个挺耗时间的. 测试用设备 设备名 原道N10 主控方案 RK2918 CPU 1 ghz RAM 512 MB 系统版本 2.3.1 象限(quadrant stand) 2000分左右 影响整个测试的硬件指标估计就这几个了,测试的环境就是上表的数据了 图表 R语言生成的: 最 快当然是直接用SQLite…(废话),从表中我们可以比较出,就ORM框架而言androrm有一丁点的速度优势,可能由于ormlite用注解字段的 方式,导致ormlite性能有着一定的损失(注解其实也是利用了反射的原理),不过,对于熟悉j2ee的朋友来讲ormlite更容易上手,而对于 python程序员学习过django这个框架的朋友更容易上手androrm.从这个简单的实验来看,官方推荐我们少用get/set方法也不是毫无道 理的,对于一个类的反射的耗时,以我的那台设备而言开销可能大约在2毫秒左右(这个以第三次androrm 与SQLite的相减再除与10000得出..),注意…这只是简单的测试而已!!!真正要比较性能还要考虑到GC的问题,所以这里这是随便说说而已! 文档活跃度 androrm ormlite 文档 不完善 超级齐全 社区 不活跃,我提交到一个bug,到现在都还没有修复的消息 活跃 更新频率 慢 很快! 个人建议,想研究怎么写orm框架的可以用androrm,想速度的开发产品,用ormlite,其实,啥都不用最好,呵呵~ 有兴趣的朋友可以下载我用来测试的源代码试一下 http://www.kuaipan.cn/file/id_2622545685705265.html [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.cnblogs.com/youxilua/archive/2012/02/02/2336102.html">[转载]android ORM框架的性能简单测试(androrm vs ormlite) &#8211; youxiachai &#8211; 博客园</a>.</p>
<div id="cnblogs_post_body">
<h4>前言</h4>
<blockquote><p>看了一下现在的 <span class='wp_keywordlink_affiliate'><a href="http://www.mikel.cn/tag/android" title="Android开发" target="_blank">Android</a></span>设备,性能都不差,就懒得直接用<span class='wp_keywordlink_affiliate'><a href="http://www.mikel.cn/tag/sql/" title="SQL" target="_blank">SQL</a></span>ite,直接上<span class='wp_keywordlink_affiliate'><a href="http://www.mikel.cn/tag/orm" title="查看 ORM 的全部文章" target="_blank">ORM</a></span>框架把,上网搜了一圈,觉得androrm, ormlite  这两个不错,当然,还有点别的,这里就不多做介绍,竟然说明了是简单测试,而本人,也不算是专业的测试人员,就测试一下这两个框架在同一设备下,插入 1w(本来是想插100w,后来插入10w,接着就只能插1w,呵呵有兴趣的可以去测试一下…)行数据的时间吧,给大家做一个简单参考,真正要做比较的 话,其实,测试,表查询才是最重要的,但是,关键我没有这样的数据源,要构建一个挺耗时间的.</p></blockquote>
<h4>测试用设备</h4>
<blockquote>
<table border="1" cellspacing="0" cellpadding="2" width="600">
<tbody>
<tr>
<td width="300" valign="top">设备名</td>
<td width="300" valign="top">原道N10</td>
</tr>
<tr>
<td width="300" valign="top">主控方案</td>
<td width="300" valign="top">RK2918</td>
</tr>
<tr>
<td width="300" valign="top">CPU</td>
<td width="300" valign="top">1 ghz</td>
</tr>
<tr>
<td width="300" valign="top">RAM</td>
<td width="300" valign="top">512 MB</td>
</tr>
<tr>
<td width="300" valign="top">系统版本</td>
<td width="300" valign="top">2.3.1</td>
</tr>
<tr>
<td width="300" valign="top">象限(quadrant stand)</td>
<td width="300" valign="top">2000分左右</td>
</tr>
</tbody>
</table>
<p>影响整个测试的硬件指标估计就这几个了,测试的环境就是上表的数据了</p></blockquote>
<h4>图表</h4>
<blockquote><p>R语言生成的:</p>
<p><a href="http://images.cnblogs.com/cnblogs_com/youxilua/201202/201202021806296565.png"><img style="border-width: 0px; display: inline;" title="Rplot" src="http://images.cnblogs.com/cnblogs_com/youxilua/201202/201202021806445609.png" border="0" alt="Rplot" width="644" height="484" /></a></p>
<p>最 快当然是直接用<span class='wp_keywordlink_affiliate'><a href="http://www.mikel.cn/tag/sql/" title="SQL" target="_blank">SQL</a></span>ite…(废话),从表中我们可以比较出,就<span class='wp_keywordlink_affiliate'><a href="http://www.mikel.cn/tag/orm" title="查看 ORM 的全部文章" target="_blank">ORM</a></span>框架而言androrm有一丁点的速度优势,可能由于ormlite用注解字段的 方式,导致ormlite性能有着一定的损失(注解其实也是利用了反射的原理),不过,对于熟悉j2ee的朋友来讲ormlite更容易上手,而对于 python程序员学习过django这个框架的朋友更容易上手androrm.从这个简单的实验来看,官方推荐我们少用get/set方法也不是毫无道 理的,对于一个类的反射的耗时,以我的那台设备而言开销可能大约在2毫秒左右(这个以第三次androrm  与<span class='wp_keywordlink_affiliate'><a href="http://www.mikel.cn/tag/sql/" title="SQL" target="_blank">SQL</a></span>ite的相减再除与10000得出..),<span style="color: #ff0000;">注意…这只是简单的测试而已!!!真正要比较性能还要考虑到GC的问题,所以这里这是随便说说而已!</span></p></blockquote>
<h4>文档活跃度</h4>
<blockquote>
<table border="1" cellspacing="0" cellpadding="2" width="600">
<tbody>
<tr>
<td width="200" valign="top"></td>
<td width="200" valign="top">androrm</td>
<td width="200" valign="top">ormlite</td>
</tr>
<tr>
<td width="200" valign="top">文档</td>
<td width="200" valign="top">不完善</td>
<td width="200" valign="top">超级齐全</td>
</tr>
<tr>
<td width="200" valign="top">社区</td>
<td width="200" valign="top">不活跃,我提交到一个bug,到现在都还没有修复的消息</td>
<td width="200" valign="top">活跃</td>
</tr>
<tr>
<td width="200" valign="top">更新频率</td>
<td width="200" valign="top">慢</td>
<td width="200" valign="top">很快!</td>
</tr>
<tr>
<td width="200" valign="top"></td>
<td width="200" valign="top"></td>
<td width="200" valign="top"></td>
</tr>
</tbody>
</table>
<p>个人建议,想研究怎么写orm框架的可以用androrm,想速度的开发产品,用ormlite,其实,啥都不用最好,呵呵~</p></blockquote>
<p>有兴趣的朋友可以下载我用来测试的源代码试一下</p>
<blockquote><p><a title="http://www.kuaipan.cn/file/id_2622545685705265.html" href="http://www.kuaipan.cn/file/id_2622545685705265.html">http://www.kuaipan.cn/file/id_2622545685705265.html</a></p></blockquote>
</div>

<a class="dt_button" href="http://www.daitui.com/bookmark?title=%5B%E8%BD%AC%E8%BD%BD%5Dandroid%20ORM%E6%A1%86%E6%9E%B6%E7%9A%84%E6%80%A7%E8%83%BD%E7%AE%80%E5%8D%95%E6%B5%8B%E8%AF%95%28androrm%20vs%20ormlite%29&amp;link=http%3A%2F%2Fwww.mikel.cn%2F%25e5%25bc%2580%25e5%258f%2591%25e7%25ac%2594%25e8%25ae%25b0%2F%25e8%25bd%25ac%25e8%25bd%25bdandroid-orm%25e6%25a1%2586%25e6%259e%25b6%25e7%259a%2584%25e6%2580%25a7%25e8%2583%25bd%25e7%25ae%2580%25e5%258d%2595%25e6%25b5%258b%25e8%25af%2595androrm-vs-ormlite.html&amp;tag=Android%2Candroid%20ORM%E6%A1%86%E6%9E%B6%E7%9A%84%E6%80%A7%E8%83%BD%E7%AE%80%E5%8D%95%E6%B5%8B%E8%AF%95%28androrm%20vs%20ormlite%29%2CORM"><img src="http://src.daitui.com/widget/01.gif" align="absmiddle" alt="收藏与分享" border="0" height="16" width="120" /></a><h2  class="related_post_title">相关日志</h2><ul class="related_post"><li><a href="http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bdandroid%e5%ba%94%e7%94%a8%e5%85%a8%e5%b1%8f%e7%9a%84%e6%96%b9%e6%b3%95.html" title="[转载]Android应用全屏的方法">[转载]Android应用全屏的方法</a></li><li><a href="http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bdandroid%e4%b8%ad%e6%96%87api%e5%90%88%e9%9b%867%e5%bc%80%e5%8f%91%e8%80%85%e6%8c%87%e5%8d%97%e5%90%88%e9%9b%862-chm%e6%a0%bc%e5%bc%8f%e4%b8%8b%e8%bd%bd.html" title="[转载]Android中文API合集(7)开发者指南合集(2) (chm格式下载)">[转载]Android中文API合集(7)开发者指南合集(2) (chm格式下载)</a></li><li><a href="http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bdandroid%e8%af%bb%e5%86%99%e6%96%87%e4%bb%b6%e5%9f%ba%e4%ba%8ejava%e7%9a%84%e6%96%87%e4%bb%b6%e8%be%93%e5%85%a5%e8%be%93%e5%87%ba%e6%b5%81.html" title="[转载]Android读写文件基于Java的文件输入输出流 ">[转载]Android读写文件基于Java的文件输入输出流 </a></li><li><a href="http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bdandroid-sax%e8%a7%a3%e6%9e%90xml.html" title="[转载]Android SAX解析XML">[转载]Android SAX解析XML</a></li><li><a href="http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bdandroid%e6%9c%8d%e5%8a%a1%e4%b9%8bservice%e5%85%b6%e4%b8%80.html" title="[转载]Android服务之Service(其一)">[转载]Android服务之Service(其一)</a></li><li><a href="http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bdandroid-ui-%e4%bd%bf%e7%94%a8%e6%9b%b4%e5%bf%ab%e6%9b%b4%e9%ab%98%e6%95%88.html" title="[转载]Android UI 使用更快更高效">[转载]Android UI 使用更快更高效</a></li><li><a href="http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bd%e4%b8%89%e6%ad%a5%e6%90%9e%e5%ae%9aandroid%e5%ba%94%e7%94%a8%e5%9b%be%e7%89%87%e7%bc%93%e5%ad%98.html" title="[转载]三步搞定android应用图片缓存">[转载]三步搞定android应用图片缓存</a></li><li><a href="http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bdandroid%e7%9a%84ui%e5%b8%83%e5%b1%80%e6%80%bb%e8%a7%88.html" title="[转载]Android的UI布局总览">[转载]Android的UI布局总览</a></li><li><a href="http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bdandroid%e4%b9%8b%e7%94%9f%e6%88%90%e6%a1%8c%e9%9d%a2%e5%bf%ab%e6%8d%b7%e6%96%b9%e5%bc%8f%ef%bc%88%e4%b8%80%ef%bc%89.html" title="[转载]Android之生成桌面快捷方式（一）">[转载]Android之生成桌面快捷方式（一）</a></li><li><a href="http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bdandroid%e5%ad%a6%e4%b9%a0%e7%ac%94%e8%ae%b0%ef%bc%88%e5%85%ad%ef%bc%89sqlite.html" title="[转载]Android学习笔记（六）SQLite">[转载]Android学习笔记（六）SQLite</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bdandroid-orm%e6%a1%86%e6%9e%b6%e7%9a%84%e6%80%a7%e8%83%bd%e7%ae%80%e5%8d%95%e6%b5%8b%e8%af%95androrm-vs-ormlite.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[转载]Android应用全屏的方法</title>
		<link>http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bdandroid%e5%ba%94%e7%94%a8%e5%85%a8%e5%b1%8f%e7%9a%84%e6%96%b9%e6%b3%95.html</link>
		<comments>http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bdandroid%e5%ba%94%e7%94%a8%e5%85%a8%e5%b1%8f%e7%9a%84%e6%96%b9%e6%b3%95.html#comments</comments>
		<pubDate>Fri, 03 Feb 2012 00:12:45 +0000</pubDate>
		<dc:creator>mikel</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[开发笔记]]></category>
		<category><![CDATA[Android应用全屏的方法]]></category>
		<category><![CDATA[全屏]]></category>

		<guid isPermaLink="false">http://www.mikel.cn/?p=9260</guid>
		<description><![CDATA[[转载]Android应用全屏的方法 &#8211; &#8211; 博客园. 一般Android的应用启动时都有欢迎界面，类似QQHD启动那样。比较大方绚丽。心动不如行动，有时间自己也来实现类似的效果，嘿嘿。 观察发现QQHD的欢迎界面是全屏的，这个好办。下面就Android应用调用全屏方式说明一下。 一般使Android程序的画面充满整个屏幕，有两种方法。 1.直接代码编写 1 @Override 2 protected void onCreate(Bundle savedInstanceState) 3 { 4 requestWindowFeature(Window.FEATURE_NO_TITLE); 5 getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); 6 super.onCreate(savedInstanceState); 7 setContentView(R.layout.welcome); 8 } 复制代码 2.配置AndroidManifest.xml 1 &#60;application 2 android:icon="@drawable/ic_launcher" 3 android:label="@string/app_name" &#62; 4 &#60;activity 5 android:name=".Welcome" 6 android:label="@string/app_name" 7 android:theme="@android:style/Theme.NoTitleBar.Fullscreen" 8 &#62; 9 &#60;intent-filter&#62; 10 &#60;action android:name="android.intent.action.MAIN" /&#62; 11 &#60;category [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.cnblogs.com/shungdawei/archive/2012/02/02/2336128.html">[转载]Android应用全屏的方法 &#8211;  &#8211; 博客园</a>.</p>
<div id="cnblogs_post_body">
<p><span style="widows: 2; text-transform: none; background-color: #ffffff; text-indent: 0px; letter-spacing: normal; display: inline ! important; font: 16px/24px Georgia,'Bitstream Charter',serif; white-space: normal; orphans: 2; float: none; color: #333333; word-spacing: 0px;">一般<span class='wp_keywordlink_affiliate'><a href="http://www.mikel.cn/tag/android" title="Android开发" target="_blank">Android</a></span>的应用启动时都有欢迎界面，类似QQHD启动那样。比较大方绚丽。心动不如行动，有时间自己也来实现类似的效果，嘿嘿。<span style="widows: 2; text-transform: none; background-color: #ffffff; text-indent: 0px; letter-spacing: normal; display: inline ! important; font: 16px/24px Georgia,'Bitstream Charter',serif; white-space: normal; orphans: 2; float: none; color: #333333; word-spacing: 0px;"><img src="http://pic002.cnblogs.com/images/2012/308972/2012020218345175.png" alt="QQ2011" width="328" height="488" /></span></span></p>
<p><span style="widows: 2; text-transform: none; background-color: #ffffff; text-indent: 0px; letter-spacing: normal; display: inline ! important; font: 16px/24px Georgia,'Bitstream Charter',serif; white-space: normal; orphans: 2; float: none; color: #333333; word-spacing: 0px;">观察发现QQHD的欢迎界面是<span class='wp_keywordlink_affiliate'><a href="http://www.mikel.cn/tag/%e5%85%a8%e5%b1%8f" title="查看 全屏 的全部文章" target="_blank">全屏</a></span>的，这个好办。下面就<span class='wp_keywordlink_affiliate'><a href="http://www.mikel.cn/tag/android" title="Android开发" target="_blank">Android</a></span>应用调用<span class='wp_keywordlink_affiliate'><a href="http://www.mikel.cn/tag/%e5%85%a8%e5%b1%8f" title="查看 全屏 的全部文章" target="_blank">全屏</a></span>方式说明一下。</span></p>
<p><span style="widows: 2; text-transform: none; background-color: #ffffff; text-indent: 0px; letter-spacing: normal; display: inline ! important; font: 16px/24px Georgia,'Bitstream Charter',serif; white-space: normal; orphans: 2; float: none; color: #333333; word-spacing: 0px;">一般使<span class='wp_keywordlink_affiliate'><a href="http://www.mikel.cn/tag/android" title="查看 Android 的全部文章" target="_blank">Android</a></span>程序的画面充满整个屏幕，有两种方法。</span></p>
<p><span style="widows: 2; text-transform: none; background-color: #ffffff; text-indent: 0px; letter-spacing: normal; display: inline ! important; font: 16px/24px Georgia,'Bitstream Charter',serif; white-space: normal; orphans: 2; float: none; color: #333333; word-spacing: 0px;">1.直接代码编写</span></p>
<div class="cnblogs_code">
<pre><span style="color: #008080;">1</span> @Override
<span style="color: #008080;">2</span>     <span style="color: #0000ff;">protected</span> <span style="color: #0000ff;">void</span> onCreate(Bundle savedInstanceState)
<span style="color: #008080;">3</span>     {
<span style="color: #008080;">4</span>         <em><strong>requestWindowFeature(Window.FEATURE_NO_TITLE);</strong></em>
<span style="color: #008080;">5</span><em><strong> getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);</strong></em>
<span style="color: #008080;">6</span>         <span style="color: #0000ff;">super</span>.onCreate(savedInstanceState);
<span style="color: #008080;">7</span>         setContentView(R.layout.welcome);
<span style="color: #008080;">8</span>     }</pre>
<div class="cnblogs_code_toolbar"><span class="cnblogs_code_copy"><a>复制代码</a></span></div>
</div>
<p><span style="widows: 2; text-transform: none; background-color: #ffffff; text-indent: 0px; letter-spacing: normal; display: inline ! important; font: 16px/24px Georgia,'Bitstream Charter',serif; white-space: normal; orphans: 2; float: none; color: #333333; word-spacing: 0px;"><br />
</span></p>
<p><span style="widows: 2; text-transform: none; background-color: #ffffff; text-indent: 0px; letter-spacing: normal; display: inline ! important; font: 16px/24px Georgia,'Bitstream Charter',serif; white-space: normal; orphans: 2; float: none; color: #333333; word-spacing: 0px;">2.<span style="widows: 2; text-transform: none; background-color: #ffffff; text-indent: 0px; letter-spacing: normal; display: inline ! important; font: 16px/24px Georgia,'Bitstream Charter',serif; white-space: normal; orphans: 2; float: none; color: #333333; word-spacing: 0px;">配置<span class='wp_keywordlink_affiliate'><a href="http://www.mikel.cn/tag/android" title="查看 Android 的全部文章" target="_blank">Android</a></span>Manifest.xml</span></span></p>
<div class="cnblogs_code">
<pre><span style="color: #008080;"> 1</span>     <span style="color: #0000ff;">&lt;</span><span style="color: #800000;">application
</span><span style="color: #008080;"> 2</span>         <span style="color: #ff0000;">android:icon</span><span style="color: #0000ff;">="@drawable/ic_launcher"</span><span style="color: #ff0000;">
</span><span style="color: #008080;"> 3</span> <span style="color: #ff0000;">        android:label</span><span style="color: #0000ff;">="@string/app_name"</span> <span style="color: #0000ff;">&gt;</span>
<span style="color: #008080;"> 4</span>         <span style="color: #0000ff;">&lt;</span><span style="color: #800000;">activity
</span><span style="color: #008080;"> 5</span>             <span style="color: #ff0000;">android:name</span><span style="color: #0000ff;">=".Welcome"</span><span style="color: #ff0000;">
</span><span style="color: #008080;"> 6</span> <span style="color: #ff0000;">            android:label</span><span style="color: #0000ff;">="@string/app_name"</span><span style="color: #ff0000;">
</span><span style="color: #008080;"> 7</span> <em><strong><span style="color: #ff0000;">            android:theme</span><span style="color: #0000ff;">="@android:style/Theme.NoTitleBar.Fullscreen"</span><span style="color: #ff0000;">
</span></strong></em><span style="color: #008080;"> 8</span>         <span style="color: #0000ff;">&gt;</span>
<span style="color: #008080;"> 9</span>             <span style="color: #0000ff;">&lt;</span><span style="color: #800000;">intent-filter</span><span style="color: #0000ff;">&gt;</span>
<span style="color: #008080;">10</span>                 <span style="color: #0000ff;">&lt;</span><span style="color: #800000;">action </span><span style="color: #ff0000;">android:name</span><span style="color: #0000ff;">="android.intent.action.MAIN"</span> <span style="color: #0000ff;">/&gt;</span>
<span style="color: #008080;">11</span>                 <span style="color: #0000ff;">&lt;</span><span style="color: #800000;">category </span><span style="color: #ff0000;">android:name</span><span style="color: #0000ff;">="android.intent.category.LAUNCHER"</span> <span style="color: #0000ff;">/&gt;</span>
<span style="color: #008080;">12</span>             <span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">intent-filter</span><span style="color: #0000ff;">&gt;</span>
<span style="color: #008080;">13</span>         <span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">activity</span><span style="color: #0000ff;">&gt;</span>
<span style="color: #008080;">14</span>         <span style="color: #0000ff;">&lt;</span><span style="color: #800000;">activity
</span><span style="color: #008080;">15</span>             <span style="color: #ff0000;">android:name</span><span style="color: #0000ff;">=".AboutApp"</span><span style="color: #ff0000;">
</span><span style="color: #008080;">16</span> <span style="color: #ff0000;">            android:label</span><span style="color: #0000ff;">="@string/aboutapp_title"</span><span style="color: #ff0000;">
</span><span style="color: #008080;">17</span> <span style="color: #ff0000;">            android:theme</span><span style="color: #0000ff;">="@android:style/Theme.Dialog"</span><span style="color: #ff0000;">
</span><span style="color: #008080;">18</span>         <span style="color: #0000ff;">/&gt;</span>
<span style="color: #008080;">19</span>     <span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">application</span><span style="color: #0000ff;">&gt;</span></pre>
<div class="cnblogs_code_toolbar"><span class="cnblogs_code_copy"><a>复制代码</a></span></div>
</div>
<p><span style="widows: 2; text-transform: none; background-color: #ffffff; text-indent: 0px; letter-spacing: normal; display: inline ! important; font: 16px/24px Georgia,'Bitstream Charter',serif; white-space: normal; orphans: 2; float: none; color: #333333; word-spacing: 0px;"><span style="widows: 2; text-transform: none; background-color: #ffffff; text-indent: 0px; letter-spacing: normal; display: inline ! important; font: 16px/24px Georgia,'Bitstream Charter',serif; white-space: normal; orphans: 2; float: none; color: #333333; word-spacing: 0px;"><img src="http://pic002.cnblogs.com/images/2012/308972/2012020218521315.png" alt="安卓示例" width="328" height="488" /></span></span></p>
</div>

<a class="dt_button" href="http://www.daitui.com/bookmark?title=%5B%E8%BD%AC%E8%BD%BD%5DAndroid%E5%BA%94%E7%94%A8%E5%85%A8%E5%B1%8F%E7%9A%84%E6%96%B9%E6%B3%95&amp;link=http%3A%2F%2Fwww.mikel.cn%2F%25e5%25bc%2580%25e5%258f%2591%25e7%25ac%2594%25e8%25ae%25b0%2F%25e8%25bd%25ac%25e8%25bd%25bdandroid%25e5%25ba%2594%25e7%2594%25a8%25e5%2585%25a8%25e5%25b1%258f%25e7%259a%2584%25e6%2596%25b9%25e6%25b3%2595.html&amp;tag=Android%2CAndroid%E5%BA%94%E7%94%A8%E5%85%A8%E5%B1%8F%E7%9A%84%E6%96%B9%E6%B3%95%2C%E5%85%A8%E5%B1%8F"><img src="http://src.daitui.com/widget/01.gif" align="absmiddle" alt="收藏与分享" border="0" height="16" width="120" /></a><h2  class="related_post_title">相关日志</h2><ul class="related_post"><li><a href="http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bdandroid-orm%e6%a1%86%e6%9e%b6%e7%9a%84%e6%80%a7%e8%83%bd%e7%ae%80%e5%8d%95%e6%b5%8b%e8%af%95androrm-vs-ormlite.html" title="[转载]android ORM框架的性能简单测试(androrm vs ormlite)">[转载]android ORM框架的性能简单测试(androrm vs ormlite)</a></li><li><a href="http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bdandroid%e4%b8%ad%e6%96%87api%e5%90%88%e9%9b%867%e5%bc%80%e5%8f%91%e8%80%85%e6%8c%87%e5%8d%97%e5%90%88%e9%9b%862-chm%e6%a0%bc%e5%bc%8f%e4%b8%8b%e8%bd%bd.html" title="[转载]Android中文API合集(7)开发者指南合集(2) (chm格式下载)">[转载]Android中文API合集(7)开发者指南合集(2) (chm格式下载)</a></li><li><a href="http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bdandroid%e8%af%bb%e5%86%99%e6%96%87%e4%bb%b6%e5%9f%ba%e4%ba%8ejava%e7%9a%84%e6%96%87%e4%bb%b6%e8%be%93%e5%85%a5%e8%be%93%e5%87%ba%e6%b5%81.html" title="[转载]Android读写文件基于Java的文件输入输出流 ">[转载]Android读写文件基于Java的文件输入输出流 </a></li><li><a href="http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bdandroid-sax%e8%a7%a3%e6%9e%90xml.html" title="[转载]Android SAX解析XML">[转载]Android SAX解析XML</a></li><li><a href="http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bdandroid%e6%9c%8d%e5%8a%a1%e4%b9%8bservice%e5%85%b6%e4%b8%80.html" title="[转载]Android服务之Service(其一)">[转载]Android服务之Service(其一)</a></li><li><a href="http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bdandroid-ui-%e4%bd%bf%e7%94%a8%e6%9b%b4%e5%bf%ab%e6%9b%b4%e9%ab%98%e6%95%88.html" title="[转载]Android UI 使用更快更高效">[转载]Android UI 使用更快更高效</a></li><li><a href="http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bd%e4%b8%89%e6%ad%a5%e6%90%9e%e5%ae%9aandroid%e5%ba%94%e7%94%a8%e5%9b%be%e7%89%87%e7%bc%93%e5%ad%98.html" title="[转载]三步搞定android应用图片缓存">[转载]三步搞定android应用图片缓存</a></li><li><a href="http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bdandroid%e7%9a%84ui%e5%b8%83%e5%b1%80%e6%80%bb%e8%a7%88.html" title="[转载]Android的UI布局总览">[转载]Android的UI布局总览</a></li><li><a href="http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bdandroid%e4%b9%8b%e7%94%9f%e6%88%90%e6%a1%8c%e9%9d%a2%e5%bf%ab%e6%8d%b7%e6%96%b9%e5%bc%8f%ef%bc%88%e4%b8%80%ef%bc%89.html" title="[转载]Android之生成桌面快捷方式（一）">[转载]Android之生成桌面快捷方式（一）</a></li><li><a href="http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bdandroid%e5%ad%a6%e4%b9%a0%e7%ac%94%e8%ae%b0%ef%bc%88%e5%85%ad%ef%bc%89sqlite.html" title="[转载]Android学习笔记（六）SQLite">[转载]Android学习笔记（六）SQLite</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bdandroid%e5%ba%94%e7%94%a8%e5%85%a8%e5%b1%8f%e7%9a%84%e6%96%b9%e6%b3%95.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[转载]c# 正则表达式 replace 高级用法</title>
		<link>http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bdc-%e6%ad%a3%e5%88%99%e8%a1%a8%e8%be%be%e5%bc%8f-replace-%e9%ab%98%e7%ba%a7%e7%94%a8%e6%b3%95.html</link>
		<comments>http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bdc-%e6%ad%a3%e5%88%99%e8%a1%a8%e8%be%be%e5%bc%8f-replace-%e9%ab%98%e7%ba%a7%e7%94%a8%e6%b3%95.html#comments</comments>
		<pubDate>Fri, 03 Feb 2012 00:11:26 +0000</pubDate>
		<dc:creator>mikel</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[开发笔记]]></category>
		<category><![CDATA[c# 正则 replace 高级用法]]></category>
		<category><![CDATA[正则表达式]]></category>

		<guid isPermaLink="false">http://www.mikel.cn/?p=9258</guid>
		<description><![CDATA[[转载]c# 正则 replace 高级用法 &#8211; 河蟹社会 &#8211; 博客园. 需求: 替换网页上所有a标签中的链接. 如:&#60;a href=&#8221;http://www.asiafinance.cn&#8221; target=&#8221;_blank&#8221;&#62;亚洲财经&#60;/a&#62;, 替换成&#60;a href=&#8221;http://www.baidu.com/?to=http://www.asiafinance.cn&#8221; target=&#8221;_blank&#8221;&#62;亚洲财经&#60;/a&#62; 刚开始的做法是用Regex.Matches方法找出a标签中所有的链接,然后循环Regex.Replace替换, 因为是整个页面的全局替换, 所以,第一个链接替换了,第二个又来一遍,直到最后一个结束.http://tactic.asiafinance.cn/   http://tactic.asiafinance.cn/list/list_czzn.shtml,替换第一个的时候,把第二个那个链接也替换,后 来就乱了. 这里解决方法还是Regex.Replace , 我把2个方法的代码都贴出来. 第一种 string content = "网站内容"; string pattern = @"&#60;a[\s\S]*?href=(""(?&#60;href&#62;[^""]*)""&#124;’(?&#60;href&#62;[^’]*)’&#124;(?&#60;href&#62;[^&#62;\s]*))[^&#62;]*?&#62;"; MatchCollection mc = Regex.Matches(content,pattern,RegexOptions.IgnoreCase&#124;RegexOptions.Compiled); foreach (Match m in mc) { string url = m.Groups["href"].Value; string replaceUrl = "http://www.baidu.com/" + "?to=" + url; [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.cnblogs.com/StruggleSomnus/archive/2012/02/02/2336088.html">[转载]c# 正则 replace 高级用法 &#8211; 河蟹社会 &#8211; 博客园</a>.</p>
<p>需求: 替换网页上所有a标签中的链接. 如:&lt;a href=&#8221;http://www.asiafinance.cn&#8221;  target=&#8221;_blank&#8221;&gt;亚洲财经&lt;/a&gt;, 替换成&lt;a  href=&#8221;http://www.baidu.com/?to=http://www.asiafinance.cn&#8221;  target=&#8221;_blank&#8221;&gt;亚洲财经&lt;/a&gt;</p>
<p>刚开始的做法是用Regex.Matches方法找出a标签中所有的链接,然后循环Regex.Replace替换, 因为是整个页面的全局替换,  所以,第一个链接替换了,第二个又来一遍,直到最后一个结束.http://tactic.asiafinance.cn/    http://tactic.asiafinance.cn/list/list_czzn.shtml,替换第一个的时候,把第二个那个链接也替换,后 来就乱了.</p>
<p>这里解决方法还是Regex.Replace , 我把2个方法的代码都贴出来.</p>
<div class="cnblogs_code"><img id="code_img_opened_b0a7d45e-40b6-4f32-b9a8-08139fc5a78d" class="code_img_opened" src="http://images.cnblogs.com/OutliningIndicators/ExpandedBlockStart.gif" alt="" /><span class="cnblogs_code_collapse">第一种</span></p>
<div id="cnblogs_code_open_b0a7d45e-40b6-4f32-b9a8-08139fc5a78d" class="cnblogs_code_hide" style="display: block;">
<pre>        <span style="color: #0000ff;">string</span> content = <span style="color: #800000;">"</span><span style="color: #800000;"><span class='wp_keywordlink_affiliate'><a href="http://www.mikel.cn/tag/%e7%bd%91%e7%ab%99" title="网站" target="_blank">网站</a></span>内容</span><span style="color: #800000;">"</span>;
<span style="color: #0000ff;">string</span> pattern = <span style="color: #800000;">@"</span><span style="color: #800000;">&lt;a[\s\S]*?href=(""(?&lt;href&gt;[^""]*)""|’(?&lt;href&gt;[^’]*)’|(?&lt;href&gt;[^&gt;\s]*))[^&gt;]*?&gt;</span><span style="color: #800000;">"</span>;
        MatchCollection mc = Regex.Matches(content,pattern,RegexOptions.IgnoreCase|RegexOptions.Compiled);
        <span style="color: #0000ff;">foreach</span> (Match m <span style="color: #0000ff;">in</span> mc)
        {
            <span style="color: #0000ff;">string</span> url = m.Groups[<span style="color: #800000;">"</span><span style="color: #800000;">href</span><span style="color: #800000;">"</span>].Value;
            <span style="color: #0000ff;">string</span> replaceUrl = <span style="color: #800000;">"</span><span style="color: #800000;">http://www.baidu.com/</span><span style="color: #800000;">"</span> + <span style="color: #800000;">"</span><span style="color: #800000;">?to=</span><span style="color: #800000;">"</span> + url;
            content = Regex.Replace(content,url,replaceUrl);
        }</pre>
<div class="cnblogs_code_toolbar"><span class="cnblogs_code_copy"><a>复制代码</a></span></div>
</div>
</div>
<div class="cnblogs_code"><img id="code_img_opened_1b15d940-3c09-4268-b0d1-6bc296fd5eff" class="code_img_opened" src="http://images.cnblogs.com/OutliningIndicators/ExpandedBlockStart.gif" alt="" /><span class="cnblogs_code_collapse">第二种</span></p>
<div id="cnblogs_code_open_1b15d940-3c09-4268-b0d1-6bc296fd5eff" class="cnblogs_code_hide" style="display: block;">
<pre>        <span style="color: #0000ff;">string</span> content = <span style="color: #800000;">"</span><span style="color: #800000;"><span class='wp_keywordlink_affiliate'><a href="http://www.mikel.cn/tag/%e7%bd%91%e7%ab%99" title="网站" target="_blank">网站</a></span>内容</span><span style="color: #800000;">"</span>;
        <span style="color: #0000ff;">string</span> pattern = <span style="color: #800000;">@"</span><span style="color: #800000;">&lt;a[\s\S]*?href=(""(?&lt;href&gt;[^""]*)""|’(?&lt;href&gt;[^’]*)’|(?&lt;href&gt;[^&gt;\s]*))[^&gt;]*?&gt;</span><span style="color: #800000;">"</span>;
        <span style="color: #0000ff;">string</span> repStr = <span style="color: #800000;">"</span><span style="color: #800000;">&lt;a target=\"_blank\" href=\"http://www.baidu.com/?to=${href}\"&gt;</span><span style="color: #800000;">"</span>;
        content = Regex.Replace(content,pattern,repStr,RegexOptions.IgnoreCase|RegexOptions.Compiled);</pre>
<div class="cnblogs_code_toolbar"><span class="cnblogs_code_copy"><a>复制代码</a></span></div>
</div>
</div>
<p>参考内容:</p>
<p><strong>替换</strong></p>
<p>Regex类有一个静态的Replace方法，其实例也有一个Replace方法，这个方法很强大，因为它可以传入一个delegate，这样，你可以自定义每次捕获匹配时，如何处理捕获的内容。</p>
<p class="code">public static void Main()<br />
{<br />
string s = &#8220;1 12 3 5&#8243;;<br />
s = Regex.Replace(s,@&#8221;\d+&#8221;,new MatchEvaluator(CorrectString),RegexOptions.Compiled|RegexOptions.IgnoreCase);<br />
Console.WriteLine(s);<br />
Console.ReadLine();<br />
}<br />
private static string CorrectString(Match match)<br />
{<br />
string matchValue = match.Value;<br />
if(matchValue.Length == 1)<br />
matchValue = &#8220;0&#8243; + matchValue;<br />
return matchValue;<br />
}</p>
<table style="width: 935px; height: 481px;" border="0">
<tbody>
<tr>
<td><strong>$number</strong></td>
<td>把匹配的第number组替换成替换表达式，还有这句话怎么写也表达不清楚意思，还是来个例子吧：public static void Main()<br />
{<br />
string s = &#8220;1 12 3 5&#8243;;<br />
s = Regex.Replace(s,@&#8221;(\d+)(?#这个是注释)&#8221;,&#8221;0$1&#8243;,RegexOptions.Compiled|RegexOptions.IgnoreCase);<br />
Console.WriteLine(s);<br />
Console.ReadLine();<br />
}</p>
<p>这段代码返回的是 “01 012 03 05”</p>
<p>就是说，对组一的每个匹配结果都用&#8221;0$1&#8243;这个表达式来替换，&#8221;0$1&#8243;中&#8221;$1&#8243;由组1匹配的结果代入</td>
</tr>
<tr>
<td><strong>${name}</strong></td>
<td>把匹配的组名为&#8221;name&#8221;的组替换成表达式，</p>
<p>上例的Regex expression改成@&#8221;(?&lt;name&gt;\d+)(?#这个是注释)&#8221;后面的替换式改为&#8221;0${name}&#8221;结果是一样的</td>
</tr>
<tr>
<td><strong>$$</strong></td>
<td>做$的转义符，如上例表达式改成@&#8221;(?&lt;name&gt;\d+)(?#这个是注释)&#8221;和&#8221;$$${name}&#8221;，则结果为&#8221;$1 $12 $3 $5&#8243;</td>
</tr>
<tr>
<td><strong>$&amp;</strong></td>
<td>替换整个匹配</td>
</tr>
<tr>
<td><strong>$`</strong></td>
<td>替换匹配前的字符</td>
</tr>
<tr>
<td><strong>$&#8217;</strong></td>
<td>替换匹配后的字符</td>
</tr>
<tr>
<td><strong>$+</strong></td>
<td>替换最后匹配的组</td>
</tr>
<tr>
<td><strong>$_</strong></td>
<td>替换整个字符串</td>
</tr>
</tbody>
</table>
<p class="code">

<a class="dt_button" href="http://www.daitui.com/bookmark?title=%5B%E8%BD%AC%E8%BD%BD%5Dc%23%20%E6%AD%A3%E5%88%99%E8%A1%A8%E8%BE%BE%E5%BC%8F%20replace%20%E9%AB%98%E7%BA%A7%E7%94%A8%E6%B3%95&amp;link=http%3A%2F%2Fwww.mikel.cn%2F%25e5%25bc%2580%25e5%258f%2591%25e7%25ac%2594%25e8%25ae%25b0%2F%25e8%25bd%25ac%25e8%25bd%25bdc-%25e6%25ad%25a3%25e5%2588%2599%25e8%25a1%25a8%25e8%25be%25be%25e5%25bc%258f-replace-%25e9%25ab%2598%25e7%25ba%25a7%25e7%2594%25a8%25e6%25b3%2595.html&amp;tag=C%23%2Cc%23%20%E6%AD%A3%E5%88%99%20replace%20%E9%AB%98%E7%BA%A7%E7%94%A8%E6%B3%95%2C%E6%AD%A3%E5%88%99%E8%A1%A8%E8%BE%BE%E5%BC%8F"><img src="http://src.daitui.com/widget/01.gif" align="absmiddle" alt="收藏与分享" border="0" height="16" width="120" /></a><h2  class="related_post_title">相关日志</h2><ul class="related_post"><li><a href="http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bd-net%e6%ad%a3%e5%88%99%e8%a1%a8%e8%be%be%e5%bc%8f%e4%b9%8b%e6%9b%bf%e6%8d%a2%e7%b1%bb%e9%ab%98%e7%ba%a7%e6%8a%80%e5%b7%a7.html" title="[转载].NET正则表达式之替换类高级技巧">[转载].NET正则表达式之替换类高级技巧</a></li><li><a href="http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bdc%e5%ad%97%e7%ac%a6%e4%b8%b2%e4%b8%8e%e4%ba%ab%e5%85%83%ef%bc%88flyweight%ef%bc%89%e6%a8%a1%e5%bc%8f.html" title="[转载]C#字符串与享元（Flyweight）模式">[转载]C#字符串与享元（Flyweight）模式</a></li><li><a href="http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bdvisual-studio-%e5%8d%b3%e6%97%b6%e7%aa%97%e5%8f%a3%e5%92%8c%e5%91%bd%e4%bb%a4%e7%aa%97%e5%8f%a3%e4%bd%bf%e7%94%a8%e6%95%99%e7%a8%8b.html" title="[转载]Visual Studio 即时窗口和命令窗口使用教程">[转载]Visual Studio 即时窗口和命令窗口使用教程</a></li><li><a href="http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bd-net-2-0%e4%b8%8b%e7%9a%84ooxml%e7%a5%9e%e5%99%a8%ef%bc%9anpoi-openxml4net.html" title="[转载].net 2.0下的OOXML神器：NPOI.OpenXml4Net">[转载].net 2.0下的OOXML神器：NPOI.OpenXml4Net</a></li><li><a href="http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bd%e7%81%ab%e8%bd%a6%e7%a5%a8%e6%8a%a2%e7%a5%a8%e5%8a%a9%e6%89%8b%e7%ae%80%e5%8c%96%e7%89%88.html" title="[转载]火车票抢票助手简化版">[转载]火车票抢票助手简化版</a></li><li><a href="http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bd%e6%b5%85%e8%b0%88c%e4%b8%ad%e5%b8%b8%e8%a7%81%e7%9a%84%e5%a7%94%e6%89%98.html" title="[转载]浅谈C#中常见的委托">[转载]浅谈C#中常见的委托</a></li><li><a href="http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bdwinrarwinzip%e5%8e%8b%e7%bc%a9%e4%b8%8e%e8%a7%a3%e5%8e%8b%e5%ae%9e%e7%8e%b0%ef%bc%88c%e7%89%88window%e5%b9%b3%e5%8f%b0%ef%bc%89.html" title="[转载]WinRAR(WinZip)压缩与解压实现（C#版Window平台）">[转载]WinRAR(WinZip)压缩与解压实现（C#版Window平台）</a></li><li><a href="http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bdc%e9%a1%b9%e7%9b%ae%e5%a6%82%e4%bd%95%e6%89%93%e5%8c%85%ef%bc%8c%e6%88%96%e8%80%85%e5%8f%ab%e7%94%9f%e6%88%90%e5%ae%89%e8%a3%85%e6%96%87%e4%bb%b6.html" title="[转载]C#项目如何打包，或者叫生成安装文件 ">[转载]C#项目如何打包，或者叫生成安装文件 </a></li><li><a href="http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bd%e6%80%bb%e7%bb%93%e4%b8%80%e4%b8%8berp-net%e7%a8%8b%e5%ba%8f%e5%91%98%e5%bf%85%e9%a1%bb%e6%8e%8c%e6%8f%a1%e7%9a%84-net%e6%8a%80%e6%9c%af.html" title="[转载]总结一下ERP .NET程序员必须掌握的.NET技术">[转载]总结一下ERP .NET程序员必须掌握的.NET技术</a></li><li><a href="http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bdxmlattribute%e4%b8%8e%e5%ae%9e%e4%bd%93%e7%9a%84%e8%bd%ac%e6%8d%a2%e5%92%8c%e5%8c%b9%e9%85%8d%e6%96%b9%e6%a1%88%ef%bc%88%e9%99%84%e6%ba%90%e7%a0%81%ef%bc%89.html" title="[转载]XmlAttribute与实体的转换和匹配方案（附源码）">[转载]XmlAttribute与实体的转换和匹配方案（附源码）</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bdc-%e6%ad%a3%e5%88%99%e8%a1%a8%e8%be%be%e5%bc%8f-replace-%e9%ab%98%e7%ba%a7%e7%94%a8%e6%b3%95.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[转载]sqlserver 行转列</title>
		<link>http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bdsqlserver-%e8%a1%8c%e8%bd%ac%e5%88%97.html</link>
		<comments>http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bdsqlserver-%e8%a1%8c%e8%bd%ac%e5%88%97.html#comments</comments>
		<pubDate>Thu, 02 Feb 2012 00:18:24 +0000</pubDate>
		<dc:creator>mikel</dc:creator>
				<category><![CDATA[开发笔记]]></category>
		<category><![CDATA[数据库]]></category>
		<category><![CDATA[SQLServer]]></category>
		<category><![CDATA[sqlserver 行转列]]></category>
		<category><![CDATA[行列转换]]></category>
		<category><![CDATA[行转列]]></category>

		<guid isPermaLink="false">http://www.mikel.cn/?p=9256</guid>
		<description><![CDATA[[转载]sqlserver 行转列 &#8211; 李 鹏 &#8211; 博客园. SQLServer把行转成列在我们编码中是经常遇到的我做一个小例子大家看一下 1 --创建一个表 2 create table PayPhoneMoney 3 ( 4 id int identity(1,1), 5 userName Nvarchar(20), 6 payType nvarchar(20), 7 money decimal, 8 payTime datetime, 9 constraint pk_id primary key(id) 10 ) 11 --插入点数据 12 insert into PayPhoneMoney values('小李','支付宝',20,'2012-01-03') 13 insert into PayPhoneMoney values('小陈','工行',20,'2012-01-06') 14 insert into PayPhoneMoney [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.cnblogs.com/li-peng/archive/2012/02/01/2334973.html">[转载]sqlserver 行转列 &#8211; 李 鹏 &#8211; 博客园</a>.</p>
<div id="cnblogs_post_body">
<p><span class='wp_keywordlink_affiliate'><a href="http://www.mikel.cn/tag/sqlserver/" title="SQLServer" target="_blank">SQLServer</a></span>把行转成列在我们编码中是经常遇到的我做一个小例子大家看一下</p>
<div class="cnblogs_code">
<pre><span style="color: #008080;"> 1</span> <span style="color: #008080;">--</span><span style="color: #008080;">创建一个表</span><span style="color: #008080;">
</span><span style="color: #008080;"> 2</span> <span style="color: #0000ff;">create</span> <span style="color: #0000ff;">table</span> PayPhoneMoney
<span style="color: #008080;"> 3</span> (
<span style="color: #008080;"> 4</span>     id <span style="color: #0000ff;">int</span> <span style="color: #ff00ff;">identity</span>(<span style="color: #800000; font-weight: bold;">1</span>,<span style="color: #800000; font-weight: bold;">1</span>),
<span style="color: #008080;"> 5</span>     userName <span style="color: #0000ff;">Nvarchar</span>(<span style="color: #800000; font-weight: bold;">20</span>),
<span style="color: #008080;"> 6</span>     payType <span style="color: #0000ff;">nvarchar</span>(<span style="color: #800000; font-weight: bold;">20</span>),
<span style="color: #008080;"> 7</span>     <span style="color: #0000ff;">money</span>   <span style="color: #0000ff;">decimal</span>,
<span style="color: #008080;"> 8</span>     payTime <span style="color: #0000ff;">datetime</span>,
<span style="color: #008080;"> 9</span>     <span style="color: #0000ff;">constraint</span> pk_id <span style="color: #0000ff;">primary</span> <span style="color: #0000ff;">key</span>(id)
<span style="color: #008080;">10</span> )
<span style="color: #008080;">11</span> <span style="color: #008080;">--</span><span style="color: #008080;">插入点数据</span><span style="color: #008080;">
</span><span style="color: #008080;">12</span> <span style="color: #0000ff;">insert</span> <span style="color: #0000ff;">into</span> PayPhoneMoney <span style="color: #0000ff;">values</span>(<span style="color: #ff0000;">'</span><span style="color: #ff0000;">小李</span><span style="color: #ff0000;">'</span>,<span style="color: #ff0000;">'</span><span style="color: #ff0000;">支付宝</span><span style="color: #ff0000;">'</span>,<span style="color: #800000; font-weight: bold;">20</span>,<span style="color: #ff0000;">'</span><span style="color: #ff0000;">2012-01-03</span><span style="color: #ff0000;">'</span>)
<span style="color: #008080;">13</span> <span style="color: #0000ff;">insert</span> <span style="color: #0000ff;">into</span> PayPhoneMoney <span style="color: #0000ff;">values</span>(<span style="color: #ff0000;">'</span><span style="color: #ff0000;">小陈</span><span style="color: #ff0000;">'</span>,<span style="color: #ff0000;">'</span><span style="color: #ff0000;">工行</span><span style="color: #ff0000;">'</span>,<span style="color: #800000; font-weight: bold;">20</span>,<span style="color: #ff0000;">'</span><span style="color: #ff0000;">2012-01-06</span><span style="color: #ff0000;">'</span>)
<span style="color: #008080;">14</span> <span style="color: #0000ff;">insert</span> <span style="color: #0000ff;">into</span> PayPhoneMoney <span style="color: #0000ff;">values</span>(<span style="color: #ff0000;">'</span><span style="color: #ff0000;">小赵</span><span style="color: #ff0000;">'</span>,<span style="color: #ff0000;">'</span><span style="color: #ff0000;">交行</span><span style="color: #ff0000;">'</span>,<span style="color: #800000; font-weight: bold;">50</span>,<span style="color: #ff0000;">'</span><span style="color: #ff0000;">2012-01-06</span><span style="color: #ff0000;">'</span>)
<span style="color: #008080;">15</span> <span style="color: #0000ff;">insert</span> <span style="color: #0000ff;">into</span> PayPhoneMoney <span style="color: #0000ff;">values</span>(<span style="color: #ff0000;">'</span><span style="color: #ff0000;">小陈</span><span style="color: #ff0000;">'</span>,<span style="color: #ff0000;">'</span><span style="color: #ff0000;">支付宝</span><span style="color: #ff0000;">'</span>,<span style="color: #800000; font-weight: bold;">60</span>,<span style="color: #ff0000;">'</span><span style="color: #ff0000;">2012-01-06</span><span style="color: #ff0000;">'</span>)
<span style="color: #008080;">16</span> <span style="color: #0000ff;">insert</span> <span style="color: #0000ff;">into</span> PayPhoneMoney <span style="color: #0000ff;">values</span>(<span style="color: #ff0000;">'</span><span style="color: #ff0000;">小赵</span><span style="color: #ff0000;">'</span>,<span style="color: #ff0000;">'</span><span style="color: #ff0000;">工行</span><span style="color: #ff0000;">'</span>,<span style="color: #800000; font-weight: bold;">30</span>,<span style="color: #ff0000;">'</span><span style="color: #ff0000;">2012-01-16</span><span style="color: #ff0000;">'</span>)
<span style="color: #008080;">17</span> <span style="color: #0000ff;">insert</span> <span style="color: #0000ff;">into</span> PayPhoneMoney <span style="color: #0000ff;">values</span>(<span style="color: #ff0000;">'</span><span style="color: #ff0000;">小张</span><span style="color: #ff0000;">'</span>,<span style="color: #ff0000;">'</span><span style="color: #ff0000;">中行</span><span style="color: #ff0000;">'</span>,<span style="color: #800000; font-weight: bold;">30</span>,<span style="color: #ff0000;">'</span><span style="color: #ff0000;">2012-01-16</span><span style="color: #ff0000;">'</span>)
<span style="color: #008080;">18</span> <span style="color: #0000ff;">insert</span> <span style="color: #0000ff;">into</span> PayPhoneMoney <span style="color: #0000ff;">values</span>(<span style="color: #ff0000;">'</span><span style="color: #ff0000;">小李</span><span style="color: #ff0000;">'</span>,<span style="color: #ff0000;">'</span><span style="color: #ff0000;">支付宝</span><span style="color: #ff0000;">'</span>,<span style="color: #800000; font-weight: bold;">60</span>,<span style="color: #ff0000;">'</span><span style="color: #ff0000;">2012-01-16</span><span style="color: #ff0000;">'</span>)</pre>
<div class="cnblogs_code_toolbar"><span class="cnblogs_code_copy"><a>复制代码</a></span></div>
</div>
<p>看一下表中的数据</p>
<p><img src="http://pic002.cnblogs.com/images/2012/342595/2012020117585588.jpg" alt="" /></p>
<p>我们要想查一下每个人所有支付形式下的总钱数如图所示</p>
<p><img src="http://pic002.cnblogs.com/images/2012/342595/2012020117593870.jpg" alt="" /></p>
<div class="cnblogs_code">
<pre><span style="color: #008080;">1</span> <span style="color: #008080;">--</span><span style="color: #008080;"> 查一下每个人所有支付形式下的总钱数</span><span style="color: #008080;">
</span><span style="color: #008080;">2</span> <span style="color: #0000ff;">select</span> userName <span style="color: #0000ff;">from</span> PayPhoneMoney <span style="color: #0000ff;">group</span> <span style="color: #0000ff;">by</span> userName
<span style="color: #008080;">3</span> <span style="color: #0000ff;">select</span> userName,
<span style="color: #008080;">4</span>     <span style="color: #ff00ff;">sum</span>(<span style="color: #ff00ff;">case</span> payType <span style="color: #0000ff;">when</span> <span style="color: #ff0000;">'</span><span style="color: #ff0000;">支付宝</span><span style="color: #ff0000;">'</span> <span style="color: #0000ff;">then</span> <span style="color: #0000ff;">money</span> <span style="color: #0000ff;">else</span> <span style="color: #800000; font-weight: bold;">0</span> <span style="color: #0000ff;">end</span>) <span style="color: #0000ff;">as</span> 支付宝 ,
<span style="color: #008080;">5</span>     <span style="color: #ff00ff;">sum</span>(<span style="color: #ff00ff;">case</span> payType <span style="color: #0000ff;">when</span> <span style="color: #ff0000;">'</span><span style="color: #ff0000;">工行</span><span style="color: #ff0000;">'</span> <span style="color: #0000ff;">then</span> <span style="color: #0000ff;">money</span> <span style="color: #0000ff;">else</span> <span style="color: #800000; font-weight: bold;">0</span> <span style="color: #0000ff;">end</span>) <span style="color: #0000ff;">as</span> 工行,
<span style="color: #008080;">6</span>     <span style="color: #ff00ff;">sum</span>(<span style="color: #ff00ff;">case</span> payType <span style="color: #0000ff;">when</span> <span style="color: #ff0000;">'</span><span style="color: #ff0000;">交行</span><span style="color: #ff0000;">'</span> <span style="color: #0000ff;">then</span> <span style="color: #0000ff;">money</span> <span style="color: #0000ff;">else</span> <span style="color: #800000; font-weight: bold;">0</span> <span style="color: #0000ff;">end</span>) <span style="color: #0000ff;">as</span> 交行,
<span style="color: #008080;">7</span>     <span style="color: #ff00ff;">sum</span>(<span style="color: #ff00ff;">case</span> payType <span style="color: #0000ff;">when</span> <span style="color: #ff0000;">'</span><span style="color: #ff0000;">中行</span><span style="color: #ff0000;">'</span> <span style="color: #0000ff;">then</span> <span style="color: #0000ff;">money</span> <span style="color: #0000ff;">else</span> <span style="color: #800000; font-weight: bold;">0</span> <span style="color: #0000ff;">end</span>) <span style="color: #0000ff;">as</span> 中行
<span style="color: #008080;">8</span> <span style="color: #0000ff;">from</span> PayPhoneMoney
<span style="color: #008080;">9</span> <span style="color: #0000ff;">group</span> <span style="color: #0000ff;">by</span> userName</pre>
<div class="cnblogs_code_toolbar"><span class="cnblogs_code_copy"><a>复制代码</a></span></div>
</div>
<p>&#8211;我们这只列出了几种支付方式实际中还有很多支付方式不能一个一个都用case when 吧<br />
&#8211;可以这样</p>
<div class="cnblogs_code">
<pre><span style="color: #008080;">1</span> <span style="color: #0000ff;">declare</span> <span style="color: #008000;">@cmdText</span> <span style="color: #0000ff;">varchar</span>(<span style="color: #800000; font-weight: bold;">8000</span>)
<span style="color: #008080;">2</span> <span style="color: #0000ff;">set</span> <span style="color: #008000;">@cmdText</span><span style="color: #808080;">=</span><span style="color: #ff0000;">'</span><span style="color: #ff0000;">select userName, </span><span style="color: #ff0000;">'</span>
<span style="color: #008080;">3</span> <span style="color: #0000ff;">select</span> <span style="color: #008000;">@cmdText</span><span style="color: #808080;">=</span><span style="color: #008000;">@cmdText</span><span style="color: #808080;">+</span><span style="color: #ff0000;">'</span><span style="color: #ff0000;"> sum(case payType when</span><span style="color: #ff0000;">'''</span><span style="color: #808080;">+</span>payType<span style="color: #808080;">+</span><span style="color: #ff0000;">'''</span><span style="color: #ff0000;">Then money else 0 end) as </span><span style="color: #ff0000;">'''</span><span style="color: #808080;">+</span>payType
<span style="color: #008080;">4</span> <span style="color: #808080;">+</span><span style="color: #ff0000;">'''</span><span style="color: #ff0000;">,</span><span style="color: #ff0000;">'</span><span style="color: #808080;">+</span><span style="color: #0000ff;">char</span>(<span style="color: #800000; font-weight: bold;">10</span>) <span style="color: #0000ff;">from</span> (<span style="color: #0000ff;">select</span> <span style="color: #0000ff;">Distinct</span> payType <span style="color: #0000ff;">from</span> PayPhoneMoney) T
<span style="color: #008080;">5</span> <span style="color: #0000ff;">print</span> <span style="color: #008000;">@cmdText</span><span style="color: #008080;">--</span><span style="color: #008080;">发现多一个逗号下面把逗号去掉</span><span style="color: #008080;">
</span><span style="color: #008080;">6</span> <span style="color: #0000ff;">set</span> <span style="color: #008000;">@cmdText</span><span style="color: #808080;">=left</span>(<span style="color: #008000;">@cmdText</span>,<span style="color: #ff00ff;">len</span>(<span style="color: #008000;">@cmdText</span>)<span style="color: #808080;">-</span><span style="color: #800000; font-weight: bold;">2</span>)<span style="color: #008080;">--</span><span style="color: #008080;">去掉逗号</span><span style="color: #008080;">
</span><span style="color: #008080;">7</span> <span style="color: #0000ff;">set</span> <span style="color: #008000;">@cmdText</span><span style="color: #808080;">=</span><span style="color: #008000;">@cmdText</span><span style="color: #808080;">+</span><span style="color: #ff0000;">'</span><span style="color: #ff0000;">from PayPhoneMoney group by userName</span><span style="color: #ff0000;">'</span>
<span style="color: #008080;">8</span> <span style="color: #0000ff;">print</span> <span style="color: #008000;">@cmdText</span>
<span style="color: #008080;">9</span> <span style="color: #0000ff;">exec</span>(<span style="color: #008000;">@cmdText</span>)</pre>
<div class="cnblogs_code_toolbar"><span class="cnblogs_code_copy"><a>复制代码</a></span></div>
</div>
<p>看一下结果是一样的吧</p>
<p><img src="http://pic002.cnblogs.com/images/2012/342595/2012020117593870.jpg" alt="" /></p>
</div>

<a class="dt_button" href="http://www.daitui.com/bookmark?title=%5B%E8%BD%AC%E8%BD%BD%5Dsqlserver%20%E8%A1%8C%E8%BD%AC%E5%88%97&amp;link=http%3A%2F%2Fwww.mikel.cn%2F%25e5%25bc%2580%25e5%258f%2591%25e7%25ac%2594%25e8%25ae%25b0%2F%25e8%25bd%25ac%25e8%25bd%25bdsqlserver-%25e8%25a1%258c%25e8%25bd%25ac%25e5%2588%2597.html&amp;tag=SQLServer%2Csqlserver%20%E8%A1%8C%E8%BD%AC%E5%88%97%2C%E8%A1%8C%E5%88%97%E8%BD%AC%E6%8D%A2%2C%E8%A1%8C%E8%BD%AC%E5%88%97"><img src="http://src.daitui.com/widget/01.gif" align="absmiddle" alt="收藏与分享" border="0" height="16" width="120" /></a><h2  class="related_post_title">相关日志</h2><ul class="related_post"><li><a href="http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bd%e6%b5%85%e8%b0%88sql-server%e4%b8%ad%e4%ba%8b%e5%8a%a1%e7%9a%84acid.html" title="[转载]浅谈SQL SERVER中事务的ACID">[转载]浅谈SQL SERVER中事务的ACID</a></li><li><a href="http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bdsqlserver%e6%89%b9%e9%87%8f%e6%b8%85%e7%90%86%e6%8c%87%e5%ae%9a%e6%95%b0%e6%8d%ae%e5%ba%93%e4%b8%ad%e6%89%80%e6%9c%89%e6%95%b0%e6%8d%ae.html" title="[转载]SqlServer批量清理指定数据库中所有数据">[转载]SqlServer批量清理指定数据库中所有数据</a></li><li><a href="http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bdsqlserver%e5%88%86%e7%a6%bb%e6%89%80%e6%9c%89%e7%94%a8%e6%88%b7%e6%95%b0%e6%8d%ae%e5%ba%93.html" title="[转载]SqlServer分离所有用户数据库">[转载]SqlServer分离所有用户数据库</a></li><li><a href="http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e5%8e%9f%e5%88%9bsqlserver%e5%ad%98%e5%82%a8%e8%bf%87%e7%a8%8b%e4%b8%ad%e7%89%b9%e6%ae%8a%e5%ad%97%e7%ac%a6%e7%9a%84like%e6%9f%a5%e8%af%a2.html" title="[原创]SQLServer存储过程中特殊字符的like查询">[原创]SQLServer存储过程中特殊字符的like查询</a></li><li><a href="http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bdsqlserver%e6%95%b0%e6%8d%ae%e5%ba%93%e5%a4%a7%e5%9e%8b%e5%ba%94%e7%94%a8%e8%a7%a3%e5%86%b3%e6%96%b9%e6%a1%88%e6%80%bb%e7%bb%93.html" title="[转载]sqlserver数据库大型应用解决方案总结 ">[转载]sqlserver数据库大型应用解决方案总结 </a></li><li><a href="http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bdt-sql%e6%9f%a5%e8%af%a2%e8%bf%9b%e9%98%b6-%e7%90%86%e8%a7%a3sql-server%e4%b8%ad%e7%b4%a2%e5%bc%95%e7%9a%84%e6%a6%82%e5%bf%b5%ef%bc%8c%e5%8e%9f%e7%90%86%e4%bb%a5%e5%8f%8a%e5%85%b6.html" title="[转载]T-SQL查询进阶&#8211;理解SQL Server中索引的概念，原理以及其他">[转载]T-SQL查询进阶&#8211;理解SQL Server中索引的概念，原理以及其他</a></li><li><a href="http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bdsql-server-2008%e4%ba%8b%e5%8a%a1%e6%97%a5%e5%bf%97%e6%b8%85%e7%90%86.html" title="[转载]SQL Server 2008事务日志清理 ">[转载]SQL Server 2008事务日志清理 </a></li><li><a href="http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bdsqlserver%e8%a1%8c%e8%bd%ac%e5%88%97%e9%97%ae%e9%a2%98-pivot%e4%bd%bf%e7%94%a8%e8%af%a6%e8%a7%a3.html" title="[转载]SQLServer行转列问题-pivot使用详解 ">[转载]SQLServer行转列问题-pivot使用详解 </a></li><li><a href="http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bd%e8%8e%b7%e5%8f%96%e6%9c%ac%e5%9c%b0%e7%bd%91%e7%bb%9c%e4%b8%ad%e5%8f%af%e7%94%a8%e7%9a%84sql-server%e5%ae%9e%e4%be%8b%e4%bf%a1%e6%81%af.html" title="[转载]获取本地网络中可用的SQL Server实例信息 ">[转载]获取本地网络中可用的SQL Server实例信息 </a></li><li><a href="http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bdsql-server-%e6%95%b0%e6%8d%ae%e7%b1%bb%e5%9e%8b%e8%af%a6%e8%a7%a3.html" title="[转载]SQL SERVER 数据类型详解">[转载]SQL SERVER 数据类型详解</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bdsqlserver-%e8%a1%8c%e8%bd%ac%e5%88%97.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[转载]asp.net mvc2网站部署在IIS6的方法</title>
		<link>http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bdasp-net-mvc2%e7%bd%91%e7%ab%99%e9%83%a8%e7%bd%b2%e5%9c%a8iis6%e7%9a%84%e6%96%b9%e6%b3%95.html</link>
		<comments>http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bdasp-net-mvc2%e7%bd%91%e7%ab%99%e9%83%a8%e7%bd%b2%e5%9c%a8iis6%e7%9a%84%e6%96%b9%e6%b3%95.html#comments</comments>
		<pubDate>Thu, 02 Feb 2012 00:15:24 +0000</pubDate>
		<dc:creator>mikel</dc:creator>
				<category><![CDATA[ASP.NET MVC]]></category>
		<category><![CDATA[开发笔记]]></category>
		<category><![CDATA[ASP.NET MVC2]]></category>
		<category><![CDATA[asp.net mvc2网站部署在IIS6的方法]]></category>
		<category><![CDATA[IIS6]]></category>

		<guid isPermaLink="false">http://www.mikel.cn/?p=9254</guid>
		<description><![CDATA[[转载]asp.net mvc2网站部署在IIS6的方法 &#8211; 我思故我在&#8230; &#8211; 博客园. 部署环境： Server 2003 +IIS6 1.先安装好IIS6，再安装.net framework 4.0和ASP.NET MVC 安装包(主要是里面的一个dll，不安装也可以，只需要找到这个dll，将MVC.dll 放入网站bin目录下，这个dll文件的默认路径是C:\Program Files\Microsoft ASP.NET\ASP.NET MVC 2\Assemblies\System.Web.Mvc.dll) 2.在IIS中新建网站设置web主目录，这个不详细说了，接着说重点 3.在发布的网站上右击【属性】&#8212;【主目录】&#8212;-【配置】，在弹出的【应用程序配置】窗口中点击【添加】，点击【浏览】将“可执行文件”设置为“C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll”，“扩展名”设置为&#8221;.mvc&#8221;，取消【确认文件是否存在】 然后在下面点击【插入】，同样选择aspnet_isapi.dll，取消【确认文件是否存在】。 在发布的网站上右击【属性】&#8211;【APS.NET】，将【ASP.NET version】设置为4.0.30319 4.在【Web服务扩展】中设置ASP.NET v4.0.30319 为允许 以上配置完成后就大功告成了，以上亲测成功，若有问题欢迎留言一起探讨！ PS:若先装的.net framework 4.0，后装的IIS，需要注册aspnet到IIS，方法如下： 注意：要以管理员的身份运行 启动cmd窗口 (win键+R )  ,找到 4.0所在的目录,本人机器目录是 C:\Windows\Microsoft.NET\Framework\v4.0.30319 启动CMD进入上面的目录C:\Windows\Microsoft.NET\Framework\v4.0.30319 运行  aspnet_regiis.exe -i 稍等一会, aspnet_regiis 注册成功 相关日志转载asp.net mvc 部署时出现错误 没有对“C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files”的写访问权限[转载]VS 2010 和 .NET 4.0 [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.cnblogs.com/samsonhuang/archive/2012/02/01/2334590.html">[转载]asp.net mvc2网站部署在IIS6的方法 &#8211; 我思故我在&#8230; &#8211; 博客园</a>.</p>
<p>部署环境： Server 2003 +<span class='wp_keywordlink_affiliate'><a href="http://www.mikel.cn/tag/iis6" title="查看 IIS6 的全部文章" target="_blank">IIS6</a></span></p>
<p>1.先安装好<span class='wp_keywordlink_affiliate'><a href="http://www.mikel.cn/tag/iis6" title="查看 IIS6 的全部文章" target="_blank">IIS6</a></span>，再安装.net framework 4.0和<span class='wp_keywordlink_affiliate'><a href="http://www.mikel.cn/tag/asp-net" title="ASP.NET" target="_blank">ASP.NET</a></span> <span class='wp_keywordlink_affiliate'><a href="http://www.mikel.cn/tag/mvc" title="MVC" target="_blank">MVC</a></span>  安装包(主要是里面的一个dll，不安装也可以，只需要找到这个dll，将<span class='wp_keywordlink_affiliate'><a href="http://www.mikel.cn/tag/mvc" title="MVC" target="_blank">MVC</a></span>.dll  放入<span class='wp_keywordlink_affiliate'><a href="http://www.mikel.cn/tag/%e7%bd%91%e7%ab%99" title="网站" target="_blank">网站</a></span>bin目录下，这个dll文件的默认路径是C:\Program Files\Microsoft <span class='wp_keywordlink_affiliate'><a href="http://www.mikel.cn/tag/asp-net" title="ASP.NET" target="_blank">ASP.NET</a></span>\ASP.NET <span class='wp_keywordlink_affiliate'><a href="http://www.mikel.cn/tag/mvc" title="MVC" target="_blank">MVC</a></span>  2\Assemblies\System.Web.Mvc.dll)</p>
<p>2.在IIS中新建<span class='wp_keywordlink_affiliate'><a href="http://www.mikel.cn/tag/%e7%bd%91%e7%ab%99" title="网站" target="_blank">网站</a></span>设置web主目录，这个不详细说了，接着说重点</p>
<p>3.在发布的<span class='wp_keywordlink_affiliate'><a href="http://www.mikel.cn/tag/%e7%bd%91%e7%ab%99" title="网站" target="_blank">网站</a></span>上右击【属性】&#8212;【主目录】&#8212;-【配置】，在弹出的【应用程序配置】窗口中点击【添加】，点击【浏览】将“可执行文件”设置为“<span style="color: #ff0000;">C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll</span>”，“扩展名”设置为&#8221;.mvc&#8221;，取消【<span style="color: #ff0000;">确认文件是否存在</span>】</p>
<p><img src="http://pic002.cnblogs.com/images/2012/310852/2012020114280143.jpg" alt="" /></p>
<p>然后在下面点击【插入】，同样选择aspnet_isapi.dll，取消【确认文件是否存在】。</p>
<p><img src="http://pic002.cnblogs.com/images/2012/310852/2012020114294364.jpg" alt="" /></p>
<p>在发布的网站上右击【属性】&#8211;【APS.NET】，将【ASP.NET version】设置为4.0.30319</p>
<p><img src="http://pic002.cnblogs.com/images/2012/310852/2012020114512054.jpg" alt="" /></p>
<p>4.在【Web服务扩展】中设置ASP.NET v4.0.30319 为允许</p>
<p><img src="http://pic002.cnblogs.com/images/2012/310852/2012020114334334.jpg" alt="" /></p>
<p>以上配置完成后就大功告成了，以上亲测成功，若有问题欢迎留言一起探讨！</p>
<p>PS:<span style="color: #ff0000;">若先装的.net framework 4.0，后装的IIS，需要注册aspnet到IIS，方法如下：</span></p>
<p><strong>注意：要以管理员的身份运行</strong></p>
<p>启动cmd窗口 (win键+R )  ,找到 4.0所在的目录,本人机器目录是<br />
C:\Windows\Microsoft.NET\Framework\v4.0.30319</p>
<p>启动CMD进入上面的目录C:\Windows\Microsoft.NET\Framework\v4.0.30319</p>
<p>运行  aspnet_regiis.exe -i</p>
<p>稍等一会, aspnet_regiis 注册成功</p>
<p><img src="http://pic002.cnblogs.com/images/2012/310852/2012020114444698.jpg" alt="" /></p>

<a class="dt_button" href="http://www.daitui.com/bookmark?title=%5B%E8%BD%AC%E8%BD%BD%5Dasp.net%20mvc2%E7%BD%91%E7%AB%99%E9%83%A8%E7%BD%B2%E5%9C%A8IIS6%E7%9A%84%E6%96%B9%E6%B3%95&amp;link=http%3A%2F%2Fwww.mikel.cn%2F%25e5%25bc%2580%25e5%258f%2591%25e7%25ac%2594%25e8%25ae%25b0%2F%25e8%25bd%25ac%25e8%25bd%25bdasp-net-mvc2%25e7%25bd%2591%25e7%25ab%2599%25e9%2583%25a8%25e7%25bd%25b2%25e5%259c%25a8iis6%25e7%259a%2584%25e6%2596%25b9%25e6%25b3%2595.html&amp;tag=ASP.NET%20MVC%2CASP.NET%20MVC2%2Casp.net%20mvc2%E7%BD%91%E7%AB%99%E9%83%A8%E7%BD%B2%E5%9C%A8IIS6%E7%9A%84%E6%96%B9%E6%B3%95%2CIIS6"><img src="http://src.daitui.com/widget/01.gif" align="absmiddle" alt="收藏与分享" border="0" height="16" width="120" /></a><h2  class="related_post_title">相关日志</h2><ul class="related_post"><li><a href="http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bdasp-net-mvc-%e9%83%a8%e7%bd%b2%e6%97%b6%e5%87%ba%e7%8e%b0%e9%94%99%e8%af%af-%e6%b2%a1%e6%9c%89%e5%af%b9%e2%80%9ccwindowsmicrosoft-netframeworkv2-0-50727temporary-asp-net-f.html" title="转载asp.net mvc 部署时出现错误 没有对“C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files”的写访问权限">转载asp.net mvc 部署时出现错误 没有对“C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files”的写访问权限</a></li><li><a href="http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bdvs-2010-%e5%92%8c-net-4-0-%e7%b3%bb%e5%88%97%e4%b9%8b%e3%80%8aasp-net-4%e4%bb%a5%e5%8f%8aasp-net-mvc-2%e4%b8%ad%e5%af%b9%e8%be%93%e5%87%ba%e8%bf%9b%e8%a1%8chtml%e7%bc%96%e7%a0%81.html" title="[转载]VS 2010 和 .NET 4.0 系列之《ASP.NET 4以及ASP.NET MVC 2中对输出进行HTML编码的新句法》篇">[转载]VS 2010 和 .NET 4.0 系列之《ASP.NET 4以及ASP.NET MVC 2中对输出进行HTML编码的新句法》篇</a></li><li><a href="http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bdasp-net-mvc-2-castle-nhibernate-%e9%a1%b9%e7%9b%ae%e5%ae%9e%e6%88%981.html" title="[转载]Asp.net MVC 2 + Castle + NHibernate 项目实战(1)">[转载]Asp.net MVC 2 + Castle + NHibernate 项目实战(1)</a></li><li><a href="http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bdasp-net-mvc2%e5%8f%b3%e9%94%ae%e8%8f%9c%e5%8d%95%e5%92%8c%e6%9c%80%e7%ae%80%e5%8d%95%e5%88%86%e9%a1%b5.html" title="[转载]ASP.NET MVC2右键菜单和最简单分页">[转载]ASP.NET MVC2右键菜单和最简单分页</a></li><li><a href="http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bdasp-net-mvc-2%e4%b8%ad%e4%bd%bf%e7%94%a8ajax%e7%9a%84%e4%b8%89%e7%a7%8d%e6%96%b9%e5%bc%8f.html" title="[转载]Asp.net mvc 2中使用Ajax的三种方式">[转载]Asp.net mvc 2中使用Ajax的三种方式</a></li><li><a href="http://www.mikel.cn/%e5%9b%be%e4%b9%a6%e4%b8%8b%e8%bd%bd/%e8%bd%ac%e8%bd%bd%c2%bb-asp-net-mvc-2-in-action.html" title="[转载]» ASP.NET MVC 2 in Action">[转载]» ASP.NET MVC 2 in Action</a></li><li><a href="http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bdasp-net-mvc2-0%e7%b3%bb%e5%88%97%e6%96%87%e7%ab%a0-mvc%e7%ae%80%e4%bb%8b%e7%af%87.html" title="[转载]Asp.net MVC2.0系列文章-MVC简介篇">[转载]Asp.net MVC2.0系列文章-MVC简介篇</a></li><li><a href="http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bdasp-net-mvc-%e5%9f%ba%e4%ba%8e%e8%a7%84%e5%88%99%e7%9a%84%e6%9d%83%e9%99%90%e8%ae%be%e8%ae%a1.html" title="[转载]Asp.net MVC 基于规则的权限设计">[转载]Asp.net MVC 基于规则的权限设计</a></li><li><a href="http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bdasp-net-mvc%e6%a1%86%e6%9e%b6vici-%e6%b5%8b%e8%af%95%e7%9a%84%e4%be%bf%e5%88%a9%e6%80%a7.html" title="[转载]ASP.NET MVC框架VICI 测试的便利性 ">[转载]ASP.NET MVC框架VICI 测试的便利性 </a></li><li><a href="http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bdasp-net-mvc-%e6%8a%8apartialview%e3%80%81view%e8%bd%ac%e6%8d%a2%e6%88%90%e5%ad%97%e7%ac%a6%e4%b8%b2.html" title="[转载]Asp.Net MVC 把PartialView、View转换成字符串">[转载]Asp.Net MVC 把PartialView、View转换成字符串</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bdasp-net-mvc2%e7%bd%91%e7%ab%99%e9%83%a8%e7%bd%b2%e5%9c%a8iis6%e7%9a%84%e6%96%b9%e6%b3%95.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[转载]ActionScript中Event类的几个属性</title>
		<link>http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bdactionscript%e4%b8%adevent%e7%b1%bb%e7%9a%84%e5%87%a0%e4%b8%aa%e5%b1%9e%e6%80%a7.html</link>
		<comments>http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bdactionscript%e4%b8%adevent%e7%b1%bb%e7%9a%84%e5%87%a0%e4%b8%aa%e5%b1%9e%e6%80%a7.html#comments</comments>
		<pubDate>Wed, 01 Feb 2012 01:53:24 +0000</pubDate>
		<dc:creator>mikel</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[开发笔记]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[ActionScript中Event类的几个属性]]></category>
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://www.mikel.cn/?p=9252</guid>
		<description><![CDATA[[转载]Event类的几个属性 &#8211; 赵杰民 &#8211; 博客园. var mc:MovieClip = new MovieClip(); mc.graphics.beginFill(0x0066cc); mc.graphics.drawRect(100,100,200,200); addChild(mc); mc.addEventListener(MouseEvent.CLICK,onClick); function onClick(e:MouseEvent):void { trace(e.type) // Event类下的，表示事件的类型 trace(e.bubbles) // Event类下的，指示事件是否为冒泡事件 trace(e.cancelable) // Event类下的，表示是否忽视事件的默认行为 } bubbles  默认false  true 说明可以使用冒泡事件false 说明不可以 cancelable默认false如果不执行默认行为，则此值为 true；否则为 false。它是只读属性如果要修改可以用preventDefault()方法，可以取消默认行为 代码可通过访问 cancelable 属性来检查是否可以阻止任何指定事件对象的默认行为。 cancelable 属性包含一个布尔值，用于指示是否可以阻止默认行为。 您可以使用 preventDefault() 方法阻止或取消与少量事件关联的默认行为。 cancelable 还可以这样理解表示某个事件的默认行为能否被阻止。 true表示可以阻止，false表示不可以。 Event类的eventPhase属性也是只读属性，表示事件流的阶段。1、表示捕获阶段 2、目标阶段 3、冒泡阶段 var sp1:Sprite = new Sprite(); var [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.cnblogs.com/z888/archive/2012/02/01/2334129.html">[转载]Event类的几个属性 &#8211; 赵杰民 &#8211; 博客园</a>.</p>
<div id="cnblogs_post_body">
<div class="cnblogs_code">
<pre><span style="color: #0000ff;">var</span> mc:MovieClip = <span style="color: #0000ff;">new</span> MovieClip();
mc.graphics.beginFill(<span style="color: #800080;">0x0066cc</span>);
mc.graphics.drawRect(<span style="color: #800080;">100</span>,<span style="color: #800080;">100</span>,<span style="color: #800080;">200</span>,<span style="color: #800080;">200</span>);
addChild(mc);
mc.addEventListener(MouseEvent.CLICK,onClick);
function onClick(e:MouseEvent):<span style="color: #0000ff;">void</span>
{
 trace(e.type)         <span style="color: #008000;">//</span><span style="color: #008000;"> Event类下的，表示事件的类型</span><span style="color: #008000;">
</span> trace(e.bubbles)      <span style="color: #008000;">//</span><span style="color: #008000;"> Event类下的，指示事件是否为冒泡事件</span><span style="color: #008000;">
</span> trace(e.cancelable)   <span style="color: #008000;">//</span><span style="color: #008000;"> Event类下的，表示是否忽视事件的默认行为</span><span style="color: #008000;">
</span>}</pre>
</div>
<p>bubbles  默认false  true 说明可以使用冒泡事件false 说明不可以</p>
<p>cancelable默认false如果不执行默认行为，则此值为 true；否则为 false。它是只读属性如果要修改可以用preventDefault()方法，可以取消默认行为</p>
<p>代码可通过访问 cancelable 属性来检查是否可以阻止任何指定事件对象的默认行为。 cancelable 属性包含一个布尔值，用于指示是否可以阻止默认行为。 您可以使用</p>
<p>preventDefault() 方法阻止或取消与少量事件关联的默认行为。</p>
<p>cancelable 还可以这样理解表示某个事件的默认行为能否被阻止。 true表示可以阻止，false表示不可以。</p>
<p>Event类的eventPhase属性也是只读属性，表示事件流的阶段。1、表示捕获阶段 2、目标阶段 3、冒泡阶段</p>
<div class="cnblogs_code">
<pre><span style="color: #0000ff;">var</span> sp1:Sprite = <span style="color: #0000ff;">new</span> Sprite();
<span style="color: #0000ff;">var</span> sp2:Sprite = <span style="color: #0000ff;">new</span> Sprite();
<span style="color: #0000ff;">this</span>.addChild(sp1);
sp1.addChild(sp2);
drawRect(sp1,<span style="color: #800080;">0xff9900</span>,<span style="color: #800080;">200</span>);
drawRect(sp2,<span style="color: #800080;">0x0000ff</span>,<span style="color: #800080;">100</span>);
function drawRect(obj:DisplayObject,c:<span style="color: #0000ff;">uint</span>,b:<span style="color: #0000ff;">uint</span>):<span style="color: #0000ff;">void</span>
{
 <span style="color: #008000;">//</span><span style="color: #008000;">  这里要把严谨模式去掉</span><span style="color: #008000;">
</span> obj.graphics.beginFill(c);
 obj.graphics.drawRect(<span style="color: #800080;">0</span>,<span style="color: #800080;">0</span>,b,b);
}
sp1.name = <span style="color: #800000;">"</span><span style="color: #800000;">sp1</span><span style="color: #800000;">"</span>;
sp2.name = <span style="color: #800000;">"</span><span style="color: #800000;">sp2</span><span style="color: #800000;">"</span>;
<span style="color: #008000;">//</span><span style="color: #008000;">  为所有节点注册事件
</span><span style="color: #008000;">//</span><span style="color: #008000;">   使用捕获阶段</span><span style="color: #008000;">
</span>stage.addEventListener(MouseEvent.CLICK,clickFunc,<span style="color: #0000ff;">true</span>);
<span style="color: #0000ff;">this</span>.addEventListener(MouseEvent.CLICK,clickFunc,<span style="color: #0000ff;">true</span>);
sp1.addEventListener(MouseEvent.CLICK,clickFunc,<span style="color: #0000ff;">true</span>);
<span style="color: #008000;">//</span><span style="color: #008000;">   使用目标阶段</span><span style="color: #008000;">
</span>sp2.addEventListener(MouseEvent.CLICK,clickFunc);      <span style="color: #008000;">//</span><span style="color: #008000;"> sp2属于目标阶段不用设置true
</span><span style="color: #008000;">//</span><span style="color: #008000;">    冒泡阶段</span><span style="color: #008000;">
</span>stage.addEventListener(MouseEvent.CLICK,clickFunc);
<span style="color: #0000ff;">this</span>.addEventListener(MouseEvent.CLICK,clickFunc);
sp1.addEventListener(MouseEvent.CLICK,clickFunc);
function clickFunc(e:MouseEvent):<span style="color: #0000ff;">void</span>
{
 <span style="color: #0000ff;">var</span> s:String = e.currentTarget.name;  <span style="color: #008000;">//</span><span style="color: #008000;"> 获得实例名</span><span style="color: #008000;">
</span> <span style="color: #0000ff;">if</span>(s)   <span style="color: #008000;">//</span><span style="color: #008000;">  如果存在实例名，那么就输出实例名</span><span style="color: #008000;">
</span> {
  trace(s,<span style="color: #800000;">"</span><span style="color: #800000;">阶段</span><span style="color: #800000;">"</span> + e.eventPhase);
 }
 <span style="color: #0000ff;">else</span>    <span style="color: #008000;">//</span><span style="color: #008000;">  如果实例名不存在，说明到达舞台，输出stage</span><span style="color: #008000;">
</span> {
  trace(<span style="color: #800000;">"</span><span style="color: #800000;">stage</span><span style="color: #800000;">"</span>,<span style="color: #800000;">"</span><span style="color: #800000;">阶段</span><span style="color: #800000;">"</span> + e.eventPhase);
 }
}</pre>
</div>
</div>

<a class="dt_button" href="http://www.daitui.com/bookmark?title=%5B%E8%BD%AC%E8%BD%BD%5DActionScript%E4%B8%ADEvent%E7%B1%BB%E7%9A%84%E5%87%A0%E4%B8%AA%E5%B1%9E%E6%80%A7&amp;link=http%3A%2F%2Fwww.mikel.cn%2F%25e5%25bc%2580%25e5%258f%2591%25e7%25ac%2594%25e8%25ae%25b0%2F%25e8%25bd%25ac%25e8%25bd%25bdactionscript%25e4%25b8%25adevent%25e7%25b1%25bb%25e7%259a%2584%25e5%2587%25a0%25e4%25b8%25aa%25e5%25b1%259e%25e6%2580%25a7.html&amp;tag=ActionScript%2CActionScript%E4%B8%ADEvent%E7%B1%BB%E7%9A%84%E5%87%A0%E4%B8%AA%E5%B1%9E%E6%80%A7%2CFlash%2CFlex"><img src="http://src.daitui.com/widget/01.gif" align="absmiddle" alt="收藏与分享" border="0" height="16" width="120" /></a><h2  class="related_post_title">相关日志</h2><ul class="related_post"><li><a href="http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bdflex%e5%85%a8%e5%b1%8f%e6%96%b9%e6%b3%95%e4%bb%8b%e7%bb%8d.html" title="[转载]Flex全屏方法介绍">[转载]Flex全屏方法介绍</a></li><li><a href="http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bd%e5%ae%9e%e7%8e%b0flex%e7%9a%84textarea%e6%96%87%e6%9c%ac%e4%b8%ad%e5%85%b3%e9%94%ae%e5%ad%97%e7%9a%84%e9%ab%98%e4%ba%ae%e6%98%be%e7%a4%ba.html" title="[转载]实现Flex的TextArea文本中关键字的高亮显示">[转载]实现Flex的TextArea文本中关键字的高亮显示</a></li><li><a href="http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bdflex-spark%e7%9a%ae%e8%82%a4%e5%ae%9a%e5%88%b6.html" title="[转载]Flex Spark皮肤定制">[转载]Flex Spark皮肤定制</a></li><li><a href="http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bd%e4%b8%8d%e7%94%a8flex%ef%bc%8c%e8%bf%9b%e8%a1%8c%e8%bd%bb%e9%87%8f%e7%ba%a7%e7%9a%84flash-ria%e5%bc%80%e5%8f%91%e4%bb%a5%e9%99%8d%e4%bd%8e%e5%8f%91%e5%b8%83%e6%96%87%e4%bb%b6.html" title="[转载]不用Flex，进行轻量级的Flash RIA开发以降低发布文件的尺寸">[转载]不用Flex，进行轻量级的Flash RIA开发以降低发布文件的尺寸</a></li><li><a href="http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bdflex-%e8%81%94%e6%9c%ba%e6%b8%b8%e6%88%8f%e5%bc%80%e5%8f%91-%e6%96%97%e5%9c%b0%e4%b8%bb%e6%b8%b8%e6%88%8f%e4%b8%80%e6%a0%b8%e5%bf%83%e9%80%bb%e8%be%91-2.html" title="[转载]flex 联机游戏开发 &#8211; 斗地主游戏:(一)核心逻辑 ">[转载]flex 联机游戏开发 &#8211; 斗地主游戏:(一)核心逻辑 </a></li><li><a href="http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bdflex-%e8%81%94%e6%9c%ba%e6%b8%b8%e6%88%8f%e5%bc%80%e5%8f%91-%e6%96%97%e5%9c%b0%e4%b8%bb%e6%b8%b8%e6%88%8f%e4%b8%80%e6%a0%b8%e5%bf%83%e9%80%bb%e8%be%91.html" title="[转载]flex 联机游戏开发 &#8211; 斗地主游戏:(一)核心逻辑 ">[转载]flex 联机游戏开发 &#8211; 斗地主游戏:(一)核心逻辑 </a></li><li><a href="http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bdflex-%e8%81%94%e6%9c%ba%e6%b8%b8%e6%88%8f%e5%bc%80%e5%8f%91%e5%9b%9b%e5%9b%bd%e5%86%9b%e6%a3%8b%e6%b8%b8%e6%88%8f%e4%ba%8c%e6%a3%8b%e7%9b%98%e6%a3%8b%e5%ad%90.html" title="[转载]flex 联机游戏开发四国军棋游戏:(二)棋盘棋子">[转载]flex 联机游戏开发四国军棋游戏:(二)棋盘棋子</a></li><li><a href="http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bdflex%e6%95%b0%e6%8d%ae%e8%ae%bf%e9%97%ae%ef%bc%9awebservice.html" title="[转载]Flex数据访问：WebService">[转载]Flex数据访问：WebService</a></li><li><a href="http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bdflash-%e7%94%9f%e6%88%90%e9%aa%8c%e8%af%81%e7%a0%81.html" title="[转载]Flash 生成验证码">[转载]Flash 生成验证码</a></li><li><a href="http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bdactionscript3-0%e4%b8%ad%e7%9a%84mvceventdispatherieventdispather%e7%9a%84%e5%ad%a6%e4%b9%a0.html" title="[转载]actionscript3.0中的MVC,EventDispather,IEventDispather的学习">[转载]actionscript3.0中的MVC,EventDispather,IEventDispather的学习</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bdactionscript%e4%b8%adevent%e7%b1%bb%e7%9a%84%e5%87%a0%e4%b8%aa%e5%b1%9e%e6%80%a7.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[转载]Android中文API合集(7)开发者指南合集(2) (chm格式下载)</title>
		<link>http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bdandroid%e4%b8%ad%e6%96%87api%e5%90%88%e9%9b%867%e5%bc%80%e5%8f%91%e8%80%85%e6%8c%87%e5%8d%97%e5%90%88%e9%9b%862-chm%e6%a0%bc%e5%bc%8f%e4%b8%8b%e8%bd%bd.html</link>
		<comments>http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bdandroid%e4%b8%ad%e6%96%87api%e5%90%88%e9%9b%867%e5%bc%80%e5%8f%91%e8%80%85%e6%8c%87%e5%8d%97%e5%90%88%e9%9b%862-chm%e6%a0%bc%e5%bc%8f%e4%b8%8b%e8%bd%bd.html#comments</comments>
		<pubDate>Wed, 01 Feb 2012 00:42:00 +0000</pubDate>
		<dc:creator>mikel</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[开发笔记]]></category>
		<category><![CDATA[Android中文API合集(7)开发者指南合集(2) (chm格式下载)]]></category>
		<category><![CDATA[图书下载]]></category>

		<guid isPermaLink="false">http://www.mikel.cn/?p=9250</guid>
		<description><![CDATA[[转载]Android中文API合集(7) + 开发者指南合集(2) (chm格式) &#8211; 农民伯伯 &#8211; 博客园. 前言 Android中文翻译组是一个非盈利性质的开源组织，至今已超过300人报名参与，关于翻译组的介绍，请看这里。欢迎更多朋友加入，发邮件到over140@gmail.com申请加入或直接参与Wiki编辑。 Android中文翻译组WIKI网站：http://wikidroid.sinaapp.com/。不管是否加入我们，请与我们一起自由编辑和分享相关中文资料。 Android中文翻译组官方网站：http://androidbox.sinaapp.com/。有在线的中文API、开发者指南、开源项目以及Android视频专栏。 本合集发布日期：2012年1月31日，涵盖历次合集内容，最新版请关注翻译组微博：http://weibo.com/android2。 截图 下载 本站 Android中文翻译组——Android开发者指南（2）.chm Android中文翻译组——Android中文API合集（7）.chm 结束 由于精力有限，目前暂停了自动更新客户端的维护，内部组织结构还在调整，推荐想参与的朋友直接参与到WIKI编辑。 相关日志[转载]android ORM框架的性能简单测试(androrm vs ormlite)[转载]Android应用全屏的方法[转载]Android读写文件基于Java的文件输入输出流 [转载]Android SAX解析XML[转载]Android服务之Service(其一)[转载]Android UI 使用更快更高效[转载]三步搞定android应用图片缓存[转载]Android的UI布局总览[转载]Android之生成桌面快捷方式（一）[转载]Android学习笔记（六）SQLite]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.cnblogs.com/over140/archive/2012/01/31/2332595.html">[转载]Android中文API合集(7) + 开发者指南合集(2) (chm格式) &#8211; 农民伯伯 &#8211; 博客园</a>.</p>
<p><strong>前言 </strong></p>
<p style="text-align: left; text-indent: 21pt;"><span class='wp_keywordlink_affiliate'><a href="http://www.mikel.cn/tag/android" title="Android开发" target="_blank">Android</a></span><span style="font-family: 宋体;">中文翻译组是一个非盈利性质的开源组织</span><span style="font-family: 宋体;">，</span><span style="font-family: 宋体;">至今已超过</span>300<span style="font-family: 宋体;">人报名参与</span><span style="font-family: 宋体;">，</span><span style="font-family: 宋体;">关于翻译组的介绍，请看</span><a href="http://www.cnblogs.com/over140/archive/2010/10/26/1861234.html"><span style="font-family: 宋体;"><span>这里</span></span></a><span style="font-family: 宋体;">。欢迎更多朋友加入，发邮件到</span><a href="mailto:over140@gmail.com">over140@gmail.com</a><span style="font-family: 宋体;">申请加入或直接参与Wiki编辑。</span></p>
<p><span class='wp_keywordlink_affiliate'><a href="http://www.mikel.cn/tag/android" title="Android开发" target="_blank">Android</a></span><span style="font-family: 宋体;">中文翻译组</span>WIKI<span style="font-family: 宋体;"><span class='wp_keywordlink_affiliate'><a href="http://www.mikel.cn/tag/%e7%bd%91%e7%ab%99" title="网站" target="_blank">网站</a></span>：</span><a href="http://wikidroid.sinaapp.com/">http://wikidroid.sinaapp.com/</a><span style="font-family: 宋体;">。</span><span style="font-family: 宋体;">不管是否加入我们，请与我们</span><span style="font-family: 宋体;">一起自由编辑和分享相关中文资料。</span></p>
<p><span><span class='wp_keywordlink_affiliate'><a href="http://www.mikel.cn/tag/android" title="查看 Android 的全部文章" target="_blank">Android</a></span></span><span style="font-family: 宋体;">中文翻译组官方<span class='wp_keywordlink_affiliate'><a href="http://www.mikel.cn/tag/%e7%bd%91%e7%ab%99" title="网站" target="_blank">网站</a></span>：</span><a href="http://androidbox.sinaapp.com/">http://androidbox.sinaapp.com/</a><span style="font-family: 宋体;">。有在线的中文</span>API<span style="font-family: 宋体;">、开发者指南、开源项目以及</span><span class='wp_keywordlink_affiliate'><a href="http://www.mikel.cn/tag/android" title="查看 Android 的全部文章" target="_blank">Android</a></span><span style="font-family: 宋体;">视频专栏。</span></p>
<p><span style="font-family: 宋体;">本合集发布日期：</span><strong><span style="color: red;">2012</span><span style="font-family: 宋体; color: red;">年</span><span style="color: red;">1</span><span style="font-family: 宋体; color: red;">月</span><span style="color: red;">31</span><span style="font-family: 宋体; color: red;">日</span></strong><span style="font-family: 宋体;">，涵盖历次合集内容，最新版请关注翻译组微博：</span><a href="http://weibo.com/android2">http://weibo.com/android2</a><span style="font-family: 宋体;">。</span></p>
<p><strong> </strong></p>
<p><strong>截图</strong></p>
<p><img src="http://images.cnblogs.com/cnblogs_com/over140/2012/1/2012-1-31_1.png" alt="" width="764" height="572" /></p>
<p><strong>下载</strong></p>
<p>本站</p>
<div>
<p><a title="Android中文翻译组——Android开发者指南（2）.chm" href="http://files.cnblogs.com/over140/2012/Android%E5%BC%80%E5%8F%91%E8%80%85%E6%8C%87%E5%8D%972.zip">Android中文翻译组——Android开发者指南（2）.chm</a></p>
<p><a title="Android中文翻译组——Android中文API合集（7）.chm " href="http://files.cnblogs.com/over140/2012/Android%E4%B8%AD%E6%96%87API%E5%90%88%E9%9B%867.zip">Android中文翻译组——Android中文API合集（7）.chm </a></p>
</div>
<p><strong>结束</strong></p>
<p>由于精力有限，目前暂停了自动更新客户端的维护，内部组织结构还在调整，推荐想参与的朋友直接参与到WIKI编辑。</p>

<a class="dt_button" href="http://www.daitui.com/bookmark?title=%5B%E8%BD%AC%E8%BD%BD%5DAndroid%E4%B8%AD%E6%96%87API%E5%90%88%E9%9B%86%287%29%E5%BC%80%E5%8F%91%E8%80%85%E6%8C%87%E5%8D%97%E5%90%88%E9%9B%86%282%29%20%28chm%E6%A0%BC%E5%BC%8F%E4%B8%8B%E8%BD%BD%29&amp;link=http%3A%2F%2Fwww.mikel.cn%2F%25e5%25bc%2580%25e5%258f%2591%25e7%25ac%2594%25e8%25ae%25b0%2F%25e8%25bd%25ac%25e8%25bd%25bdandroid%25e4%25b8%25ad%25e6%2596%2587api%25e5%2590%2588%25e9%259b%25867%25e5%25bc%2580%25e5%258f%2591%25e8%2580%2585%25e6%258c%2587%25e5%258d%2597%25e5%2590%2588%25e9%259b%25862-chm%25e6%25a0%25bc%25e5%25bc%258f%25e4%25b8%258b%25e8%25bd%25bd.html&amp;tag=Android%2CAndroid%E4%B8%AD%E6%96%87API%E5%90%88%E9%9B%86%287%29%E5%BC%80%E5%8F%91%E8%80%85%E6%8C%87%E5%8D%97%E5%90%88%E9%9B%86%282%29%20%28chm%E6%A0%BC%E5%BC%8F%E4%B8%8B%E8%BD%BD%29%2C%E5%9B%BE%E4%B9%A6%E4%B8%8B%E8%BD%BD"><img src="http://src.daitui.com/widget/01.gif" align="absmiddle" alt="收藏与分享" border="0" height="16" width="120" /></a><h2  class="related_post_title">相关日志</h2><ul class="related_post"><li><a href="http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bdandroid-orm%e6%a1%86%e6%9e%b6%e7%9a%84%e6%80%a7%e8%83%bd%e7%ae%80%e5%8d%95%e6%b5%8b%e8%af%95androrm-vs-ormlite.html" title="[转载]android ORM框架的性能简单测试(androrm vs ormlite)">[转载]android ORM框架的性能简单测试(androrm vs ormlite)</a></li><li><a href="http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bdandroid%e5%ba%94%e7%94%a8%e5%85%a8%e5%b1%8f%e7%9a%84%e6%96%b9%e6%b3%95.html" title="[转载]Android应用全屏的方法">[转载]Android应用全屏的方法</a></li><li><a href="http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bdandroid%e8%af%bb%e5%86%99%e6%96%87%e4%bb%b6%e5%9f%ba%e4%ba%8ejava%e7%9a%84%e6%96%87%e4%bb%b6%e8%be%93%e5%85%a5%e8%be%93%e5%87%ba%e6%b5%81.html" title="[转载]Android读写文件基于Java的文件输入输出流 ">[转载]Android读写文件基于Java的文件输入输出流 </a></li><li><a href="http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bdandroid-sax%e8%a7%a3%e6%9e%90xml.html" title="[转载]Android SAX解析XML">[转载]Android SAX解析XML</a></li><li><a href="http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bdandroid%e6%9c%8d%e5%8a%a1%e4%b9%8bservice%e5%85%b6%e4%b8%80.html" title="[转载]Android服务之Service(其一)">[转载]Android服务之Service(其一)</a></li><li><a href="http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bdandroid-ui-%e4%bd%bf%e7%94%a8%e6%9b%b4%e5%bf%ab%e6%9b%b4%e9%ab%98%e6%95%88.html" title="[转载]Android UI 使用更快更高效">[转载]Android UI 使用更快更高效</a></li><li><a href="http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bd%e4%b8%89%e6%ad%a5%e6%90%9e%e5%ae%9aandroid%e5%ba%94%e7%94%a8%e5%9b%be%e7%89%87%e7%bc%93%e5%ad%98.html" title="[转载]三步搞定android应用图片缓存">[转载]三步搞定android应用图片缓存</a></li><li><a href="http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bdandroid%e7%9a%84ui%e5%b8%83%e5%b1%80%e6%80%bb%e8%a7%88.html" title="[转载]Android的UI布局总览">[转载]Android的UI布局总览</a></li><li><a href="http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bdandroid%e4%b9%8b%e7%94%9f%e6%88%90%e6%a1%8c%e9%9d%a2%e5%bf%ab%e6%8d%b7%e6%96%b9%e5%bc%8f%ef%bc%88%e4%b8%80%ef%bc%89.html" title="[转载]Android之生成桌面快捷方式（一）">[转载]Android之生成桌面快捷方式（一）</a></li><li><a href="http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bdandroid%e5%ad%a6%e4%b9%a0%e7%ac%94%e8%ae%b0%ef%bc%88%e5%85%ad%ef%bc%89sqlite.html" title="[转载]Android学习笔记（六）SQLite">[转载]Android学习笔记（六）SQLite</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bdandroid%e4%b8%ad%e6%96%87api%e5%90%88%e9%9b%867%e5%bc%80%e5%8f%91%e8%80%85%e6%8c%87%e5%8d%97%e5%90%88%e9%9b%862-chm%e6%a0%bc%e5%bc%8f%e4%b8%8b%e8%bd%bd.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[转载]解决SWFUpload在Chrome、Firefox等浏览器下的问题</title>
		<link>http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bd%e8%a7%a3%e5%86%b3swfupload%e5%9c%a8chrome%e3%80%81firefox%e7%ad%89%e6%b5%8f%e8%a7%88%e5%99%a8%e4%b8%8b%e7%9a%84%e9%97%ae%e9%a2%98.html</link>
		<comments>http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bd%e8%a7%a3%e5%86%b3swfupload%e5%9c%a8chrome%e3%80%81firefox%e7%ad%89%e6%b5%8f%e8%a7%88%e5%99%a8%e4%b8%8b%e7%9a%84%e9%97%ae%e9%a2%98.html#comments</comments>
		<pubDate>Wed, 01 Feb 2012 00:38:20 +0000</pubDate>
		<dc:creator>mikel</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[开发笔记]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[SwfUpload]]></category>
		<category><![CDATA[SWFUpload在Chrome、Firefox等浏览器下的问题]]></category>
		<category><![CDATA[文件上传]]></category>

		<guid isPermaLink="false">http://www.mikel.cn/?p=9248</guid>
		<description><![CDATA[[转载]解决SWFUpload在Chrome、Firefox等浏览器下的问题 &#8211; 杨中科 &#8211; 博客园. SWFUpload 是一个非常不错的异步上传组件，但是在Chrome、Firefox等浏览器下使用的时候会有问题。问题如下：为了防止跳过上传页面直接向“接受 SWFUpload上传的一般处理程序”（假如是Upload.ashx）发送请求造成WebShell漏洞，我的系统中对于Upload.ashx进行 了权限控制，只有登录用户才能进行上传。在IE下没问题，但是在Chrome下运行报错“用户未登录”。 经过搜索得知：因为SWFUpload是靠Flash进行上传的，Flash在IE下会把当前页面的Cookie发到Upload.ashx，但是Chrome、Firefox下则不会把当前页面的Cookie发到Upload.ashx。因为Session是靠Cookie中保存的SessionId实现的（传智播客的ASP.NET视频教程中讲到了Session和Cookie的关系，对于这点不熟悉的可以参考《传智播客视频教程2011版：ASP.NET≠拖控件》），这样由于当前页面的Cookie不会传递给Flash请求的Upload.ashx，因此请求的文件发送到Upload.ashx就是一个新的Session了，当然这个Session就是没有登录的了。 解决这个问题的思路也很简单，那就是手动把SessionId传递给服务器，再服务器端读出SessionId再加载Session。其实解决问题的办法SWFUpload的Demo中已经给出了，那就是在SWFUpload的构造函数中设置post_params参数： swfu = new SWFUpload({ // Backend Settings upload_url: "/Upload.ashx", post_params: { "ASPSESSID": "&#60;%=Session.SessionID %&#62;"}, post_params中设定的键值对将会以Form表单的形式传递到Upload.ashx，也就是SWFUpload提供了为请求增加自定义请求参数的接口。 上面的代码把当前页面的SessionId写到ASPSESSID值中，当用户上传文件后，ASPSESSID就会传递到服务器上了，在Global.asax的Application_BeginRequest中添加如下代码： var Request = HttpContext.Current.Request; var Response = HttpContext.Current.Response; /* Fix for the Flash Player Cookie bug in Non-IE browsers. * Since Flash Player always sends the IE cookies [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.cnblogs.com/rupeng/archive/2012/01/30/2332427.html">[转载]解决SWFUpload在Chrome、Firefox等浏览器下的问题 &#8211; 杨中科 &#8211; 博客园</a>.</p>
<div id="cnblogs_post_body">
<p style="widows: 2; text-transform: none; background-color: #f7f7f7; text-indent: 2em; font: medium Simsun; white-space: normal; orphans: 2; letter-spacing: normal; color: #000000; word-spacing: 0px;">SWFUpload 是一个非常不错的异步上传组件，但是在Chrome、Firefox等浏览器下使用的时候会有问题。问题如下：为了防止跳过上传页面直接向“接受 SWFUpload上传的一般处理程序”（假如是Upload.ashx）发送请求造成WebShell漏洞，我的系统中对于Upload.ashx进行 了权限控制，只有登录用户才能进行上传。在IE下没问题，但是在Chrome下运行报错“用户未登录”。</p>
<p style="widows: 2; text-transform: none; background-color: #f7f7f7; text-indent: 2em; font: medium Simsun; white-space: normal; orphans: 2; letter-spacing: normal; color: #000000; word-spacing: 0px;">经过搜索得知：因为SWFUpload是靠Flash进行上传的，<strong>Flash在IE下会把当前页面的Cookie发到Upload.ashx，但是Chrome、Firefox下则不会把当前页面的Cookie发到Upload.ashx。</strong>因为<strong>Session是靠Cookie中保存的SessionId实现的</strong>（传智播客的<span class='wp_keywordlink_affiliate'><a href="http://www.mikel.cn/tag/asp-net" title="ASP.NET" target="_blank">ASP.NET</a></span>视频教程中讲到了Session和Cookie的关系，对于这点不熟悉的可以参考<a style="color: blue; text-decoration: underline;" href="http://net.itcast.cn/452.htm" target="_blank">《传智播客视频教程2011版：ASP.NET≠拖控件》</a>），这样由于当前页面的Cookie不会传递给Flash请求的Upload.ashx，因此请求的文件发送到Upload.ashx就是一个新的Session了，当然这个Session就是没有登录的了。</p>
<p style="widows: 2; text-transform: none; background-color: #f7f7f7; text-indent: 2em; font: medium Simsun; white-space: normal; orphans: 2; letter-spacing: normal; color: #000000; word-spacing: 0px;">解决这个问题的思路也很简单，那就是手动把SessionId传递给服务器，再服务器端读出SessionId再加载Session。其实解决问题的办法SWFUpload的Demo中已经给出了，那就是在SWFUpload的构造函数中设置post_params参数：</p>
<div style="widows: 2; text-transform: none; background-color: #f7f7f7; text-indent: 0px; margin: 0px; font: medium Simsun; white-space: normal; orphans: 2; letter-spacing: normal; color: #000000; word-spacing: 0px; padding: 0px;">
<div class="cnblogs_code">
<pre>                swfu = <span style="color: #0000ff;">new</span> SWFUpload({
                    <span style="color: #008000;">//</span><span style="color: #008000;"> Backend Settings</span><span style="color: #008000;">
</span>                    upload_url: "/Upload.ashx",
                    post_params: {
                        "ASPSESSID": "&lt;%=Session.SessionID %&gt;"},</pre>
</div>
</div>
<div style="widows: 2; text-transform: none; background-color: #f7f7f7; text-indent: 0px; margin: 0px; font: medium Simsun; white-space: normal; orphans: 2; letter-spacing: normal; color: #000000; word-spacing: 0px; padding: 0px;">post_params中设定的键值对将会以Form表单的形式传递到Upload.ashx，也就是SWFUpload提供了为请求增加自定义请求参数的接口。</div>
<div style="widows: 2; text-transform: none; background-color: #f7f7f7; text-indent: 0px; margin: 0px; font: medium Simsun; white-space: normal; orphans: 2; letter-spacing: normal; color: #000000; word-spacing: 0px; padding: 0px;"></div>
<div style="widows: 2; text-transform: none; background-color: #f7f7f7; text-indent: 0px; margin: 0px; font: medium Simsun; white-space: normal; orphans: 2; letter-spacing: normal; color: #000000; word-spacing: 0px; padding: 0px;">上面的代码把当前页面的SessionId写到ASPSESSID值中，当用户上传文件后，ASPSESSID就会传递到服务器上了，在Global.asax的Application_BeginRequest中添加如下代码：</div>
<div style="widows: 2; text-transform: none; background-color: #f7f7f7; text-indent: 0px; margin: 0px; font: medium Simsun; white-space: normal; orphans: 2; letter-spacing: normal; color: #000000; word-spacing: 0px; padding: 0px;">
<div class="cnblogs_code">
<pre>            <span style="color: #0000ff;">var</span> Request = HttpContext.Current.Request;
            <span style="color: #0000ff;">var</span> Response = HttpContext.Current.Response;
            <span style="color: #008000;">/*</span><span style="color: #008000;"> Fix for the Flash Player Cookie bug in Non-IE browsers.
             * Since Flash Player always sends the IE cookies even in FireFox
             * we have to bypass the cookies by sending the values as part of the POST or GET
             * and overwrite the cookies with the passed in values.
             *
             * The theory is that at this point (BeginRequest) the cookies have not been read by
             * the Session and Authentication logic and if we update the cookies here we'll get our
             * Session and Authentication restored correctly
             </span><span style="color: #008000;">*/</span>

            <span style="color: #0000ff;">try</span>
            {
                <span style="color: #0000ff;">string</span> session_param_name = <span style="color: #800000;">"</span><span style="color: #800000;">ASPSESSID</span><span style="color: #800000;">"</span>;
                <span style="color: #0000ff;">string</span> session_cookie_name = <span style="color: #800000;">"</span><span style="color: #800000;"><span class='wp_keywordlink_affiliate'><a href="http://www.mikel.cn/tag/asp-net" title="ASP.NET" target="_blank">ASP.NET</a></span>_SESSIONID</span><span style="color: #800000;">"</span>;

                <span style="color: #0000ff;">if</span> (HttpContext.Current.Request.Form[session_param_name] != <span style="color: #0000ff;">null</span>)
                {
                    UpdateCookie(session_cookie_name, HttpContext.Current.Request.Form[session_param_name]);
                }
                <span style="color: #0000ff;">else</span> <span style="color: #0000ff;">if</span> (HttpContext.Current.Request.QueryString[session_param_name] != <span style="color: #0000ff;">null</span>)
                {
                    UpdateCookie(session_cookie_name, HttpContext.Current.Request.QueryString[session_param_name]);
                }
            }
            <span style="color: #0000ff;">catch</span> (Exception)
            {
                Response.StatusCode = <span style="color: #800080;">500</span>;
                Response.Write(<span style="color: #800000;">"</span><span style="color: #800000;">Error Initializing Session</span><span style="color: #800000;">"</span>);
            }</pre>
</div>
</div>
<div style="widows: 2; text-transform: none; background-color: #f7f7f7; text-indent: 0px; margin: 0px; font: medium Simsun; white-space: normal; orphans: 2; letter-spacing: normal; color: #000000; word-spacing: 0px; padding: 0px;"></div>
<div style="widows: 2; text-transform: none; background-color: #f7f7f7; text-indent: 0px; margin: 0px; font: medium Simsun; white-space: normal; orphans: 2; letter-spacing: normal; color: #000000; word-spacing: 0px; padding: 0px;">其中UpdateCookie方法的定义如下：</div>
<div style="widows: 2; text-transform: none; background-color: #f7f7f7; text-indent: 0px; margin: 0px; font: medium Simsun; white-space: normal; orphans: 2; letter-spacing: normal; color: #000000; word-spacing: 0px; padding: 0px;">
<div class="cnblogs_code">
<pre>        <span style="color: #0000ff;">static</span> <span style="color: #0000ff;">void</span> UpdateCookie(<span style="color: #0000ff;">string</span> cookie_name, <span style="color: #0000ff;">string</span> cookie_value)
        {
            HttpCookie cookie = HttpContext.Current.Request.Cookies.Get(cookie_name);
            <span style="color: #0000ff;">if</span> (cookie == <span style="color: #0000ff;">null</span>)
            {
                cookie = <span style="color: #0000ff;">new</span> HttpCookie(cookie_name);
                <span style="color: #008000;">//</span><span style="color: #008000;">SWFUpload 的Demo中给的代码有问题，需要加上cookie.Expires 设置才可以</span><span style="color: #008000;">
</span>                cookie.Expires = DateTime.Now.AddYears(<span style="color: #800080;">1</span>);
                HttpContext.Current.Request.Cookies.Add(cookie);
            }
            cookie.Value = cookie_value;
            HttpContext.Current.Request.Cookies.Set(cookie);
        }</pre>
</div>
</div>
<p style="widows: 2; text-transform: none; background-color: #f7f7f7; text-indent: 2em; font: medium Simsun; white-space: normal; orphans: 2; letter-spacing: normal; color: #000000; word-spacing: 0px;">原理：当用户请求到达<span class='wp_keywordlink_affiliate'><a href="http://www.mikel.cn/tag/asp-net" title="ASP.NET" target="_blank">ASP.NET</a></span>引擎的时候Application_BeginRequest方法首先被调用，在方法中看客户端是否提交上来了ASPSESSID，如果有的话则<strong>把ASPSESSID的值写入Cookie（以&#8221;ASP.NET_SESSIONID&#8221;为Key，因为ASP.Net中SessionId就是保存在&#8221;ASP.NET_SESSIONID&#8221;为Key的Cookie中的）</strong>，Application_BeginRequest方法后就可以从Cookie中读取到&#8221;ASP.NET_SESSIONID&#8221;的值还原出页面的Session了。</p>
<p style="widows: 2; text-transform: none; background-color: #f7f7f7; text-indent: 2em; font: medium Simsun; white-space: normal; orphans: 2; letter-spacing: normal; color: #000000; word-spacing: 0px;">如果<span class='wp_keywordlink_affiliate'><a href="http://www.mikel.cn/tag/%e7%bd%91%e7%ab%99" title="网站" target="_blank">网站</a></span>中还用到了Membership的FormsAuthentication验证，则还需要把AUTHID也按照SessionID的方法进行处理，<span style="color: #ff0000;">这一点是其他讲到SWFUpload这个Bug处理的文章中没有提到的。</span></p>
<p style="widows: 2; text-transform: none; background-color: #f7f7f7; text-indent: 2em; font: medium Simsun; white-space: normal; orphans: 2; letter-spacing: normal; color: #000000; word-spacing: 0px;">在SWFUpload的构造函数中设置post_params参数：</p>
<div style="widows: 2; text-transform: none; background-color: #f7f7f7; text-indent: 0px; margin: 0px; font: medium Simsun; white-space: normal; orphans: 2; letter-spacing: normal; color: #000000; word-spacing: 0px; padding: 0px;">
<div class="cnblogs_code">
<pre>                swfu = <span style="color: #0000ff;">new</span> SWFUpload({
                    <span style="color: #008000;">//</span><span style="color: #008000;"> Backend Settings</span><span style="color: #008000;">
</span>                    upload_url: "/AdminHT/UploadArticleImg.ashx",
                    post_params: {
                        "ASPSESSID": "&lt;%=Session.SessionID %&gt;",
                        "AUTHID" : "&lt;%=Request.Cookies[FormsAuthentication.FormsCookieName].Value%&gt;"
                    },</pre>
</div>
</div>
<div style="widows: 2; text-transform: none; background-color: #f7f7f7; text-indent: 0px; margin: 0px; font: medium Simsun; white-space: normal; orphans: 2; letter-spacing: normal; color: #000000; word-spacing: 0px; padding: 0px;">在在Global.asax的Application_BeginRequest中添加如下代码：</div>
<div style="widows: 2; text-transform: none; background-color: #f7f7f7; text-indent: 0px; margin: 0px; font: medium Simsun; white-space: normal; orphans: 2; letter-spacing: normal; color: #000000; word-spacing: 0px; padding: 0px;">
<div class="cnblogs_code">
<pre>            <span style="color: #0000ff;">try</span>
            {
                <span style="color: #0000ff;">string</span> auth_param_name = <span style="color: #800000;">"</span><span style="color: #800000;">AUTHID</span><span style="color: #800000;">"</span>;
                <span style="color: #0000ff;">string</span> auth_cookie_name = FormsAuthentication.FormsCookieName;

                <span style="color: #0000ff;">if</span> (HttpContext.Current.Request.Form[auth_param_name] != <span style="color: #0000ff;">null</span>)
                {
                    UpdateCookie(auth_cookie_name, HttpContext.Current.Request.Form[auth_param_name]);
                }
                <span style="color: #0000ff;">else</span> <span style="color: #0000ff;">if</span> (HttpContext.Current.Request.QueryString[auth_param_name] != <span style="color: #0000ff;">null</span>)
                {
                    UpdateCookie(auth_cookie_name, HttpContext.Current.Request.QueryString[auth_param_name]);
                }

            }
            <span style="color: #0000ff;">catch</span> (Exception)
            {
                Response.StatusCode = <span style="color: #800080;">500</span>;
                Response.Write(<span style="color: #800000;">"</span><span style="color: #800000;">Error Initializing Forms Authentication</span><span style="color: #800000;">"</span>);
            }</pre>
</div>
</div>
</div>

<a class="dt_button" href="http://www.daitui.com/bookmark?title=%5B%E8%BD%AC%E8%BD%BD%5D%E8%A7%A3%E5%86%B3SWFUpload%E5%9C%A8Chrome%E3%80%81Firefox%E7%AD%89%E6%B5%8F%E8%A7%88%E5%99%A8%E4%B8%8B%E7%9A%84%E9%97%AE%E9%A2%98&amp;link=http%3A%2F%2Fwww.mikel.cn%2F%25e5%25bc%2580%25e5%258f%2591%25e7%25ac%2594%25e8%25ae%25b0%2F%25e8%25bd%25ac%25e8%25bd%25bd%25e8%25a7%25a3%25e5%2586%25b3swfupload%25e5%259c%25a8chrome%25e3%2580%2581firefox%25e7%25ad%2589%25e6%25b5%258f%25e8%25a7%2588%25e5%2599%25a8%25e4%25b8%258b%25e7%259a%2584%25e9%2597%25ae%25e9%25a2%2598.html&amp;tag=JavaScript%2CSwfUpload%2CSWFUpload%E5%9C%A8Chrome%E3%80%81Firefox%E7%AD%89%E6%B5%8F%E8%A7%88%E5%99%A8%E4%B8%8B%E7%9A%84%E9%97%AE%E9%A2%98%2C%E6%96%87%E4%BB%B6%E4%B8%8A%E4%BC%A0"><img src="http://src.daitui.com/widget/01.gif" align="absmiddle" alt="收藏与分享" border="0" height="16" width="120" /></a><h2  class="related_post_title">相关日志</h2><ul class="related_post"><li><a href="http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e5%8e%9f%e5%88%9bswfupload%e8%83%bd%e4%b8%8a%e4%bc%a0%e8%a7%86%e9%a2%91%e4%b8%8d%e8%83%bd%e6%8f%90%e4%ba%a4%e8%a1%a8%e5%8d%95%e7%9a%84%e9%97%ae%e9%a2%98%e8%a7%a3%e5%86%b3%e5%8a%9e%e6%b3%95.html" title="[原创]SWFUpload能上传视频不能提交表单的问题解决办法">[原创]SWFUpload能上传视频不能提交表单的问题解决办法</a></li><li><a href="http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bdjquery%e6%8f%92%e4%bb%b6%e5%88%b6%e4%bd%9c%e5%bf%83%e5%be%97.html" title="[转载]jquery插件制作心得">[转载]jquery插件制作心得</a></li><li><a href="http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bd%e9%99%8d%e4%bd%8e%e5%8d%b3%e6%97%b6%e6%90%9c%e7%b4%a2%e7%9a%84%e6%9c%8d%e5%8a%a1%e5%99%a8%e5%8e%8b%e5%8a%9b.html" title="[转载]降低即时搜索的服务器压力">[转载]降低即时搜索的服务器压力</a></li><li><a href="http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e5%8e%9f%e5%88%9beasyui%e7%9a%84datagrid%e7%bb%84%e4%bb%b6getfooterrows%e4%bd%bf%e7%94%a8%e6%95%99%e7%a8%8b.html" title="[原创]EasyUI的Datagrid组件getFooterRows使用教程">[原创]EasyUI的Datagrid组件getFooterRows使用教程</a></li><li><a href="http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e5%8e%9f%e5%88%9beasyui1-2-5%e4%b8%adnumberbox%e8%b5%8b%e5%80%bc%e7%9a%84%e9%97%ae%e9%a2%98.html" title="[原创]EasyUI1.2.5中Numberbox赋值的问题">[原创]EasyUI1.2.5中Numberbox赋值的问题</a></li><li><a href="http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bd%e4%b8%a4%e5%88%86%e9%92%9f%e5%ae%8c%e6%88%90%e7%bd%91%e4%b8%8a%e8%ae%a2%e7%a5%a8%e4%bb%8e%e7%99%bb%e5%bd%95%e5%88%b0%e4%bb%98%e6%ac%be.html" title="[转载]两分钟完成网上订票从登录到付款">[转载]两分钟完成网上订票从登录到付款</a></li><li><a href="http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bdjavascript%e8%8e%b7%e5%8f%96%e5%ae%a2%e6%88%b7%e7%ab%afmac%e5%9c%b0%e5%9d%80.html" title="[转载]JavaScript获取客户端MAC地址">[转载]JavaScript获取客户端MAC地址</a></li><li><a href="http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bdwindows-%e4%b8%8b%e7%9a%84-nodejs.html" title="[转载]Windows 下的 Nodejs">[转载]Windows 下的 Nodejs</a></li><li><a href="http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bd%e6%8a%80%e6%9c%af%e5%ae%85-%e6%88%91%e7%9a%84%e7%bd%91%e4%b8%8a%e6%8a%a2%e7%81%ab%e8%bd%a6%e7%a5%a8%e6%94%bb%e7%95%a5%ef%bc%88%e7%bb%88%e6%9e%81%e7%a7%92%e6%9d%80%e7%89%88.html" title="[转载]技术宅&#8212;我的网上抢火车票攻略（终极秒杀版）">[转载]技术宅&#8212;我的网上抢火车票攻略（终极秒杀版）</a></li><li><a href="http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bd%e6%8a%80%e6%9c%af%e5%ae%85%e7%bd%91%e4%b8%8a%e4%b9%b0%e7%81%ab%e8%bd%a6%e7%a5%a8%e6%94%bb%e7%95%a5.html" title="[转载]技术宅网上买火车票攻略 ">[转载]技术宅网上买火车票攻略 </a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/%e8%bd%ac%e8%bd%bd%e8%a7%a3%e5%86%b3swfupload%e5%9c%a8chrome%e3%80%81firefox%e7%ad%89%e6%b5%8f%e8%a7%88%e5%99%a8%e4%b8%8b%e7%9a%84%e9%97%ae%e9%a2%98.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic page generated in 2.266 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2012-02-06 06:53:09 -->

