<?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>无风的港湾 &#187; ASP</title>
	<atom:link href="http://www.5bay.cn/tag/asp/feed" rel="self" type="application/rss+xml" />
	<link>http://www.5bay.cn</link>
	<description>让你我停泊~</description>
	<lastBuildDate>Fri, 16 Dec 2011 09:18:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>开源软件的盈利模式</title>
		<link>http://www.5bay.cn/me/kaiyuanruanjiandeyinglimoshi.html</link>
		<comments>http://www.5bay.cn/me/kaiyuanruanjiandeyinglimoshi.html#comments</comments>
		<pubDate>Wed, 29 Jun 2011 05:48:56 +0000</pubDate>
		<dc:creator>江小邪</dc:creator>
				<category><![CDATA[邪人邪语]]></category>
		<category><![CDATA[ASP]]></category>
		<category><![CDATA[div]]></category>
		<category><![CDATA[ie]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[代码]]></category>
		<category><![CDATA[操作系统]]></category>
		<category><![CDATA[源代码]]></category>
		<category><![CDATA[营销]]></category>
		<category><![CDATA[表]]></category>
		<category><![CDATA[软件]]></category>

		<guid isPermaLink="false">http://www.5bay.cn/?p=572</guid>
		<description><![CDATA[<a href="http://www.5bay.cn/me/kaiyuanruanjiandeyinglimoshi.html"><img align="left" hspace="5" width="150" height="150" src="http://www.5bay.cn/wp-content/plugins/thumbnail-for-excerpts/tfe_no_thumb.png" class="alignleft wp-post-image tfe" alt="" title="" /></a>盈利模式之一：多种产品线 在这种模式中，利用开源软件为直接产生收入的专有软件来创造或维持一种市场地位。例如，开放源代码的客户端软件带动了服务器软件的销售，或者借用开源版本带动商业许可版本的产品销售。这种模式应用的比较普遍。如 MySQL 产品就同时推出面向个人和企业的两种版本，即开源版本和专业版本，分别采用不同的授权方式。开源版本完全免费以便更好的推广，而从专业版的许可销售和支持服务获得收入。再如 Redhat 自 Redhat Linux 9.0 后将原桌面操作系统转为 Fedora 项目，借 Fedora Core Linux 在开源社区的声望而促进 Redhat Enterprise Linux AS/ES/WS 服务器产品线的销售。 盈利模式之二：技术服务型 在这种模式中，开放源代码软件采用了一种全新的市场定位，并非面向产品，而是针对技术服务。JBoss就是这种模式的典型代表。JBoss 应用服务器完全免费，而通过提供技术文档、培训、二次开发支持等技术服务而获得收入。 盈利模式之三：应用服务托管（ASP） 这种模式适用于基于开源软件的应用服务供应商（ASP）。 例如，PHP Live！ 就是一种构架于 PHP、MySQL 之上的开源软件，它可为企业用户提供实时交谈服务。目前已经有数十家公开提供 PHP Live！ 托管服务的应用服务提供商。 盈利模式之四：软、硬件一体化 这种模式是针对硬件制造商的。随着竞争的普及，市场压力迫使硬件公司开发并维护软件，但是软件本身却并不是利润中心，因而采用开源软件。 这种模式为大型公司广泛采纳，比如 IBM HP 等服务器供应商巨头，通过捆绑免费的 Linux 操作系统销售硬件服务器。SUN 公司近期将其 Solaris 操作系统开放源码，以确保服务器硬件的销售收入，也是这种模式的体现。 盈利模式之五：附属品 在这种模式中，出售开放源代码的附加产品。比如在低端市场，出售杯子和T恤衫等；在高端市场上，出售专业编辑出版的文档和书籍。O&#8217;Reilly集团是销售开源软件附加产品公司的典型案例，他出版了很多优秀的开放源代码软件的参考资料。O&#8217;Reilly实际上雇用和支持了一些著名的开放源代码黑客（例如Larry Wall和Brain Behlendorf），并以此提高它在市场上的声望。 盈利模式之六：品牌战略、服务致上 在这种模式中，开源公司通过开源软件先天的传播优势，以极低的成本建立和传播品牌。并通过向用户提供产品相关的服务来获得回报。 康比尔公司的 Compiere ERP &#38; [...]]]></description>
			<content:encoded><![CDATA[<div><strong><span style="color: #0000ff;">盈利模式之一：多种产品线</span></strong></div>
<div>在这种模式中，利用开源软件为直接产生收入的专有软件来创造或维持一种市场地位。例如，开放源代码的客户端软件带动了服务器软件的销售，或者借用开源版本带动商业许可版本的产品销售。这种模式应用的比较普遍。如 <a href="http://www.5bay.cn/tag/mysql" class="st_tag internal_tag" rel="tag" title="标签 mysql 下的日志">MySQL</a> 产品就同时推出面向个人和企业的两种版本，即开源版本和专业版本，分别采用不同的授权方式。开源版本完全免费以便更好的推广，而从专业版的许可销售和支持服务获得收入。再如 Redhat 自 Redhat Linux 9.0 后将原桌面操作系统转为 Fedora 项目，借 Fedora Core Linux 在开源社区的声望而促进 Redhat Enterprise Linux AS/ES/WS 服务器产品线的销售。</div>
<div><span style="color: #0000ff;"><strong>盈利模式之二：技术服务型</strong></span></div>
<div>在这种模式中，开放源代码软件采用了一种全新的市场定位，并非面向产品，而是针对技术服务。JBoss就是这种模式的典型代表。JBoss 应用服务器完全免费，而通过提供技术文档、培训、二次开发支持等技术服务而获得收入。</div>
<div><strong><span style="color: #0000ff;">盈利模式之三：应用服务托管（ASP）</span></strong></div>
<div>这种模式适用于基于开源软件的应用服务供应商（ASP）。</div>
<div>例如，<a href="http://www.5bay.cn/tag/php" class="st_tag internal_tag" rel="tag" title="标签 PHP 下的日志">PHP</a> Live！ 就是一种构架于 <a href="http://www.5bay.cn/tag/php" class="st_tag internal_tag" rel="tag" title="标签 PHP 下的日志">PHP</a>、MySQL 之上的开源软件，它可为企业用户提供实时交谈服务。目前已经有数十家公开提供 <a href="http://www.5bay.cn/tag/php" class="st_tag internal_tag" rel="tag" title="标签 PHP 下的日志">PHP</a> Live！ 托管服务的应用服务提供商。</div>
<div><span style="color: #0000ff;"><strong>盈利模式之四：软、硬件一体化</strong></span></div>
<div>这种模式是针对硬件制造商的。随着竞争的普及，市场压力迫使硬件公司开发并维护软件，但是软件本身却并不是利润中心，因而采用开源软件。 这种模式为大型公司广泛采纳，比如 IBM HP 等服务器供应商巨头，通过捆绑免费的 Linux 操作系统销售硬件服务器。SUN 公司近期将其 Solaris 操作系统开放源码，以确保服务器硬件的销售收入，也是这种模式的体现。</div>
<div><strong><span style="color: #0000ff;">盈利模式之五：附属品</span></strong></div>
<div>在这种模式中，出售开放源代码的附加产品。比如在低端市场，出售杯子和T恤衫等；在高端市场上，出售专业编辑出版的文档和书籍。O&#8217;Reilly集团是销售开源软件附加产品公司的典型案例，他出版了很多优秀的开放源代码软件的参考资料。O&#8217;Reilly实际上雇用和支持了一些著名的开放源代码黑客（例如Larry Wall和Brain Behlendorf），并以此提高它在市场上的声望。</div>
<div><strong><span style="color: #0000ff;">盈利模式之六：品牌战略、服务致上</span></strong></div>
<div>在这种模式中，开源公司通过开源软件先天的传播优势，以极低的成本建立和传播品牌。并通过向用户提供产品相关的服务来获得回报。 康比尔公司的 Compiere ERP &amp; CRM 软件是这种模式的典型案例。康比尔公司开发了开源的 ERP &amp; CRM <a href="http://www.5bay.cn/tag/%E8%BD%AF%E4%BB%B6" class="st_tag internal_tag" rel="tag" title="标签 软件 下的日志">软件</a>，由于其产品优秀，很快便获得了北美、欧洲和亚洲中小企业用户的认可，Compiere 品牌也因此迅速地传播到了世界各地，在企业管理软件市场已经成为全球知名品牌。</div>
<div><strong><span style="color: #0000ff;">盈利模式之七：市场策略</span></strong></div>
<div>这种模式，是一种快速抢占市场的营销策略，主要是为以后增强版产品的销售打下基础。 这种情形的案例有很多。比如，微软宣称部分的公开 Office 的源代码，就是执行这种策略。另一个案例则是CRM 领域的新星 SugarCRM，这款由速加科技开发的开源版本从2004年上半年公开下载后广为传播，为在9月推出的盒装专业版套件做好口碑上的准备。</div>
<div>开源软件的经营模式多种多样，随着开源软件的发展，会有更多的盈利模式应运而生。事实上，一家公司可能混合采用其中的几种盈利模式，比如康比尔公司不仅采用了第六种品牌策略，同时也采用了第二种提供技术服务的方式。 在开源软件大潮的冲击之下，包括微软在内的商业软件公司，也开始认可开源软件”软件成为服务”的本质。微软支持的金牌合作伙伴已经提供包括 Exchange <a href="http://www.5bay.cn/tag/server" class="st_tag internal_tag" rel="tag" title="标签 server 下的日志">Server</a> 2003、SharePoint <a href="http://www.5bay.cn/tag/server" class="st_tag internal_tag" rel="tag" title="标签 server 下的日志">Server</a> 2003 等在内的托管服务，如 ASP-One.com 每月每用户起价1美元的 SharePoint <a href="http://www.5bay.cn/tag/server" class="st_tag internal_tag" rel="tag" title="标签 server 下的日志">Server</a> 2003 租赁服务和全包价9.95美元每月的Exchange <a href="http://www.5bay.cn/tag/server" class="st_tag internal_tag" rel="tag" title="标签 server 下的日志">Server</a> 2003 租赁服务。 在欧洲和亚太地区各国政府的压力下，微软被迫开放Windows 和Office 的部分源代码，以改善政府的信任度，赢得庞大的政府采购订单。 开源软件的商业运动正方兴未艾。这是否会对传统的商业模式构成致命一击？开源软件在走向成熟的过程中，企业用户和政府用户由怀疑上升到愿意尝试，并最终形成了信任。开源软件已经成为软件业未来发展的重要趋势。正如 Navica 公司 CEO 本纳德·高登所说，”短短两三年间，任何人在选择任何企业软件之时，都开始考虑一个问题：是否有开源软件可作替代？”</div>
<div>***老文章，不知道原文出处</div>
<h2  class="related_post_title">相关博文</h2><ul class="related_post"><li>2010年05月23日 -- <a href="http://www.5bay.cn/server-building/mysqlyouhuajiquanwensousuo.html" title="mysql优化及全文搜索">mysql优化及全文搜索</a> (0)</li><li>2010年07月28日 -- <a href="http://www.5bay.cn/server-building/webshelleechueeee.html" title="Webshell下破解计算机管理员密码">Webshell下破解计算机管理员密码</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/peeeeee.html" title="深入探讨PHP中的内存管理问题">深入探讨PHP中的内存管理问题</a> (0)</li><li>2010年05月23日 -- <a href="http://www.5bay.cn/server-building/rsyncxiangjie.html" title="Rsync详解">Rsync详解</a> (0)</li><li>2010年05月23日 -- <a href="http://www.5bay.cn/network-programming/phpfengzhuangchangyongjavascriptweijsleiyibiankuaisudiaoyong.html" title="PHP封装常用Javascript为JS类以便快速调用">PHP封装常用Javascript为JS类以便快速调用</a> (1)</li><li>2010年05月23日 -- <a href="http://www.5bay.cn/network-programming/phpzhongdememcachehanshukumemcachefunctions.html" title="PHP中的Memcache函数库（Memcache Functions）">PHP中的Memcache函数库（Memcache Functions）</a> (0)</li><li>2010年07月28日 -- <a href="http://www.5bay.cn/server-building/aoeempirebakeebshell.html" title="帝国备份王(Empirebak)拿webshell">帝国备份王(Empirebak)拿webshell</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/phpeecketee.html" title="PHP和Socket简介">PHP和Socket简介</a> (0)</li><li>2010年05月23日 -- <a href="http://www.5bay.cn/server-building/nginxderewriteguize.html" title="nginx的rewrite规则">nginx的rewrite规则</a> (1)</li><li>2011年06月29日 -- <a href="http://www.5bay.cn/android%e7%ac%94%e8%ae%b0/zaiandroidzhongchuangjianqidongjiemian.html" title="在Android中创建启动界面">在Android中创建启动界面</a> (0)</li><li>2011年06月29日 -- <a href="http://www.5bay.cn/game-development/zishenshejishitonyventricejiexishoujiyouxikaifadesigecengci.html" title="资深设计师Tony Ventrice解析手机游戏开发的四个层次">资深设计师Tony Ventrice解析手机游戏开发的四个层次</a> (0)</li><li>2010年08月17日 -- <a href="http://www.5bay.cn/server-building/nginxxiansu.html" title="Nginx限速">Nginx限速</a> (0)</li><li>2010年07月28日 -- <a href="http://www.5bay.cn/server-building/eeprn-asp-jpg.html" title="如何删除删不掉的”PRN.asp:.jpg”">如何删除删不掉的”PRN.asp:.jpg”</a> (0)</li><li>2010年07月28日 -- <a href="http://www.5bay.cn/server-building/ep.html" title="让IIS只监听指定IP">让IIS只监听指定IP</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/eeeeeeee.html" title="最令PHP初学者头痛的十四个问题">最令PHP初学者头痛的十四个问题</a> (0)</li></ul>
	标签Tags：<a href="http://www.5bay.cn/tag/asp" title="ASP" rel="tag">ASP</a>, <a href="http://www.5bay.cn/tag/div" title="div" rel="tag">div</a>, <a href="http://www.5bay.cn/tag/ie" title="ie" rel="tag">ie</a>, <a href="http://www.5bay.cn/tag/mysql" title="mysql" rel="tag">mysql</a>, <a href="http://www.5bay.cn/tag/php" title="PHP" rel="tag">PHP</a>, <a href="http://www.5bay.cn/tag/server" title="server" rel="tag">server</a>, <a href="http://www.5bay.cn/tag/%E4%BB%A3%E7%A0%81" title="代码" rel="tag">代码</a>, <a href="http://www.5bay.cn/tag/%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F" title="操作系统" rel="tag">操作系统</a>, <a href="http://www.5bay.cn/tag/%E6%BA%90%E4%BB%A3%E7%A0%81" title="源代码" rel="tag">源代码</a>, <a href="http://www.5bay.cn/tag/%E8%90%A5%E9%94%80" title="营销" rel="tag">营销</a>, <a href="http://www.5bay.cn/tag/%E8%A1%A8" title="表" rel="tag">表</a>, <a href="http://www.5bay.cn/tag/%E8%BD%AF%E4%BB%B6" title="软件" rel="tag">软件</a>, <a href="http://www.5bay.cn/category/me" title="邪人邪语" rel="tag">邪人邪语</a><br />
]]></content:encoded>
			<wfw:commentRss>http://www.5bay.cn/me/kaiyuanruanjiandeyinglimoshi.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ASP防注入新方式，希望对大家是有用的</title>
		<link>http://www.5bay.cn/server-building/aspeaojie.html</link>
		<comments>http://www.5bay.cn/server-building/aspeaojie.html#comments</comments>
		<pubDate>Wed, 28 Jul 2010 02:00:27 +0000</pubDate>
		<dc:creator>江小邪</dc:creator>
				<category><![CDATA[服务器构建&安全]]></category>
		<category><![CDATA[ASP]]></category>
		<category><![CDATA[js]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[url]]></category>
		<category><![CDATA[人]]></category>
		<category><![CDATA[代码]]></category>
		<category><![CDATA[工具]]></category>
		<category><![CDATA[数据]]></category>
		<category><![CDATA[数据库]]></category>
		<category><![CDATA[方法]]></category>
		<category><![CDATA[程序]]></category>
		<category><![CDATA[类]]></category>
		<category><![CDATA[网站]]></category>
		<category><![CDATA[诫]]></category>
		<category><![CDATA[连接]]></category>
		<category><![CDATA[防注入]]></category>

		<guid isPermaLink="false">http://www.5bay.cn/?p=527</guid>
		<description><![CDATA[<a href="http://www.5bay.cn/server-building/aspeaojie.html"><img align="left" hspace="5" width="150" height="150" src="http://www.5bay.cn/wp-content/plugins/thumbnail-for-excerpts/tfe_no_thumb.png" class="alignleft wp-post-image tfe" alt="" title="" /></a>最近我的网站经常把js脚本注入到数据，清除了又来。先后在网上找了很多的方法，还是没有用的，十分恼火。 首先先告诉大家一个批量清除代码的sql语句。 update 表名 set 字段=replace(字段,&#8217;script src=http://3b3.org/c.js&#62; 1、分析那些无聊的人，或者有些病态的人究竟做了些什么 。 通过iis的日志或者microsoft urlscan 日志查看，在一些通过id查询数据库内容的时候后面被人加了一段很长的字符窜。 %%3B%%44%%65%%43%%4C%%61%%52%%45%%类似这样的字符窜，一定是其他的方式编码 首先我们先用工具分析下如此之长的字符窜究竟包含了些什么内容。 通过批量替换工具把%%全部替换成空，然后把得到的字符串通过其他的转码工具，转成字符窜。 ;DeCLaRE @S NvArCHaR(4000);SeT @S=CaSt(0&#215;45这里代码去掉了06F007200 aS NvArChAR(4000));ExEc(@S);&#8211; 就是一段与通过id查询数据库同时执行的sql，就给数据库某些表的字段加入了js病毒连接。 2、所以我们的原来的防sql注入的字符串就需要升级了。 如果过滤16进制 ; 对应 3B DeCLaRE 对应 4465434C615245 @ 对应 40 NvArCHaR 对应 4E76417243486152 set 对应 536554 CaSt 对应 43615374 as 对应 6153 exec 对应 45784563 - 对应 2D 把16进制的代码用&#124;隔开放到injdata 里面 injdata = [...]]]></description>
			<content:encoded><![CDATA[<p>最近我的网站经常把js脚本注入到数据，清除了又来。先后在网上找了很多的方法，还是没有用的，十分恼火。</p>
<p>首先先告诉大家一个批量清除代码的sql语句。</p>
<p>update 表名 set 字段=replace(字段,&#8217;script src=http://3b3.org/c.js&gt;<br />
1、分析那些无聊的人，或者有些病态的人究竟做了些什么 。</p>
<p>通过iis的日志或者microsoft urlscan 日志查看，在一些通过id查询数据库内容的时候后面被人加了一段很长的字符窜。</p>
<p>%%3B%%44%%65%%43%%4C%%61%%52%%45%%类似这样的字符窜，一定是其他的方式编码</p>
<p>首先我们先用工具分析下如此之长的字符窜究竟包含了些什么内容。</p>
<p>通过批量替换工具把%%全部替换成空，然后把得到的字符串通过其他的转码工具，转成字符窜。</p>
<p>;DeCLaRE @S NvArCHaR(4000);SeT @S=CaSt(0&#215;45这里代码去掉了06F007200 aS NvArChAR(4000));ExEc(@S);&#8211;</p>
<p>就是一段与通过id查询数据库同时执行的sql，就给数据库某些表的字段加入了js病毒连接。</p>
<p>2、所以我们的原来的防sql注入的字符串就需要升级了。</p>
<p>如果过滤16进制</p>
<p>; 对应 3B</p>
<p>DeCLaRE 对应 4465434C615245</p>
<p>@ 对应 40</p>
<p>NvArCHaR 对应 4E76417243486152</p>
<p>set 对应 536554</p>
<p>CaSt 对应 43615374</p>
<p>as 对应 6153</p>
<p>exec 对应 45784563</p>
<p>- 对应 2D</p>
<p>把16进制的代码用|隔开放到injdata 里面</p>
<p>injdata = “3B|2D|&#8217;|;|and|exec|insert|select|delete%20from|update|count|”</p>
<p>然后自己测试下，程序是否拦击了这些16进制的代码，本人测试过是可以拦击的，如果不加入这些是不拦击的</p>
<p>照样可以注入到数据库。</p>
<h2  class="related_post_title">相关博文</h2><ul class="related_post"><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/eesoneeajaxeehuai.html" title="基于JSON的高级AJAX开发技术">基于JSON的高级AJAX开发技术</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/eeeeeeee.html" title="最令PHP初学者头痛的十四个问题">最令PHP初学者头痛的十四个问题</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/phpeefangeredoc.html" title="php的文档句法(heredoc)<<<和PHP字符串操作">php的文档句法(heredoc)<<<和PHP字符串操作</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/eejaxeeeeee.html" title="使用Ajax时的十个常犯的错误">使用Ajax时的十个常犯的错误</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/phpeezhanchang.html" title="PHP安全之数据过滤">PHP安全之数据过滤</a> (0)</li><li>2010年05月23日 -- <a href="http://www.5bay.cn/server-building/rsyncxiangjie.html" title="Rsync详解">Rsync详解</a> (0)</li><li>2010年05月23日 -- <a href="http://www.5bay.cn/network-programming/phpfengzhuangchangyongjavascriptweijsleiyibiankuaisudiaoyong.html" title="PHP封装常用Javascript为JS类以便快速调用">PHP封装常用Javascript为JS类以便快速调用</a> (1)</li><li>2010年05月23日 -- <a href="http://www.5bay.cn/server-building/mysqlyouhuajiquanwensousuo.html" title="mysql优化及全文搜索">mysql优化及全文搜索</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/phpeeeeeeeehuai.html" title="PHP对文本数据库的基本操作方法">PHP对文本数据库的基本操作方法</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajaxeeee.html" title="Ajax的工作原理">Ajax的工作原理</a> (1)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajax.html" title="AJAX的各种控件和类库">AJAX的各种控件和类库</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/xmlhttpe.html" title="XMLHTTP对象封装技术">XMLHTTP对象封装技术</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajaxxuan.html" title="ajax的缺点">ajax的缺点</a> (0)</li><li>2010年05月23日 -- <a href="http://www.5bay.cn/server-building/eacceleratoryumemcachedequbieyuyongtu.html" title="eAccelerator与memcache的区别与用途">eAccelerator与memcache的区别与用途</a> (2)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/phpeecketee.html" title="PHP和Socket简介">PHP和Socket简介</a> (0)</li></ul>
	标签Tags：<a href="http://www.5bay.cn/tag/asp" title="ASP" rel="tag">ASP</a>, <a href="http://www.5bay.cn/tag/js" title="js" rel="tag">js</a>, <a href="http://www.5bay.cn/tag/sql" title="sql" rel="tag">sql</a>, <a href="http://www.5bay.cn/tag/url" title="url" rel="tag">url</a>, <a href="http://www.5bay.cn/tag/%E4%BA%BA" title="人" rel="tag">人</a>, <a href="http://www.5bay.cn/tag/%E4%BB%A3%E7%A0%81" title="代码" rel="tag">代码</a>, <a href="http://www.5bay.cn/tag/%E5%B7%A5%E5%85%B7" title="工具" rel="tag">工具</a>, <a href="http://www.5bay.cn/tag/%E6%95%B0%E6%8D%AE" title="数据" rel="tag">数据</a>, <a href="http://www.5bay.cn/tag/%E6%95%B0%E6%8D%AE%E5%BA%93" title="数据库" rel="tag">数据库</a>, <a href="http://www.5bay.cn/tag/%E6%96%B9%E6%B3%95" title="方法" rel="tag">方法</a>, <a href="http://www.5bay.cn/category/server-building" title="服务器构建&amp;安全" rel="tag">服务器构建&amp;安全</a>, <a href="http://www.5bay.cn/tag/%E7%A8%8B%E5%BA%8F" title="程序" rel="tag">程序</a>, <a href="http://www.5bay.cn/tag/%E7%B1%BB" title="类" rel="tag">类</a>, <a href="http://www.5bay.cn/tag/%E7%BD%91%E7%AB%99" title="网站" rel="tag">网站</a>, <a href="http://www.5bay.cn/tag/e" title="诫" rel="tag">诫</a>, <a href="http://www.5bay.cn/tag/%E8%BF%9E%E6%8E%A5" title="连接" rel="tag">连接</a>, <a href="http://www.5bay.cn/tag/%E9%98%B2%E6%B3%A8%E5%85%A5" title="防注入" rel="tag">防注入</a><br />
]]></content:encoded>
			<wfw:commentRss>http://www.5bay.cn/server-building/aspeaojie.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>如何删除删不掉的”PRN.asp:.jpg”</title>
		<link>http://www.5bay.cn/server-building/eeprn-asp-jpg.html</link>
		<comments>http://www.5bay.cn/server-building/eeprn-asp-jpg.html#comments</comments>
		<pubDate>Wed, 28 Jul 2010 01:59:36 +0000</pubDate>
		<dc:creator>江小邪</dc:creator>
				<category><![CDATA[服务器构建&安全]]></category>
		<category><![CDATA[ASP]]></category>
		<category><![CDATA[代码]]></category>
		<category><![CDATA[属性]]></category>
		<category><![CDATA[工具]]></category>
		<category><![CDATA[操作系统]]></category>
		<category><![CDATA[系统]]></category>
		<category><![CDATA[网站]]></category>
		<category><![CDATA[隐藏]]></category>

		<guid isPermaLink="false">http://www.5bay.cn/?p=525</guid>
		<description><![CDATA[<a href="http://www.5bay.cn/server-building/eeprn-asp-jpg.html"><img align="left" hspace="5" width="150" height="150" src="http://www.5bay.cn/wp-content/plugins/thumbnail-for-excerpts/tfe_no_thumb.png" class="alignleft wp-post-image tfe" alt="" title="" /></a>一个用户的网站被挂马 很多以prn.开头的文件&#8230;这个文件其实是windows禁止建立的..但是可以在dos建立 所以在dos下用更改属性 结果不让改 然后想恢复权限 不让恢复 ，网站的跟目录被加了几个文件，怎么删也删不掉， prn.gupiao.asp prn.liuhe.asp com1.shouji.asp 或是COM2，COM8等文件主，   第一步：打开工具&#62;文件夹选项&#62;查看&#62;有一项为”隐藏受保护的操作系统文件(推荐)”,去掉其前边的钩,选中”显示所有文件和文件夹” 第二步：建立一个del.bat的文件 把以下代码黏贴进去&#8230; DEL /F /A /Q \\?\%1 RD /S /Q \\?\%1 然后要删那个文件就把那个文件拖进去即可&#8230;. 但是又遇到问题了&#8230;有一个顽固的&#8230;PRN.asp;.jpg 拖进去也删不掉&#8230;. 不过没问题 这个也可以删&#8230;先把这个文件的文件夹里的其他的文件备份&#8230; 然后把文件夹拖过去&#8230;^_^ 删了吧&#8230; 然后把备份的文件 拷回去 ok了 相关博文2010年05月23日 -- Rsync详解 (0)2010年07月28日 -- ASP防注入新方式，希望对大家是有用的 (0)2010年05月23日 -- mysql优化及全文搜索 (0)2011年06月29日 -- Android在线开发工具 App Inventor (0)2011年06月29日 -- 开源软件的盈利模式 (0)2011年06月29日 -- 资深设计师Tony Ventrice解析手机游戏开发的四个层次 (0)2010年07月26日 [...]]]></description>
			<content:encoded><![CDATA[<p>一个用户的网站被挂马 很多以prn.开头的文件&#8230;这个文件其实是windows禁止建立的..但是可以在dos建立</p>
<p>所以在dos下用更改属性 结果不让改</p>
<p>然后想恢复权限 不让恢复 ，网站的跟目录被加了几个文件，怎么删也删不掉，</p>
<p>prn.gupiao.<a href="http://www.5bay.cn/tag/asp" class="st_tag internal_tag" rel="tag" title="标签 ASP 下的日志">asp</a></p>
<p>prn.liuhe.asp</p>
<p>com1.shouji.asp</p>
<p>或是COM2，COM8等文件主，  </p>
<p>第一步：打开工具&gt;文件夹选项&gt;查看&gt;有一项为”隐藏受保护的操作系统文件(推荐)”,去掉其前边的钩,选中”显示所有文件和文件夹”</p>
<p>第二步：建立一个del.bat的文件 把以下代码黏贴进去&#8230;</p>
<p>DEL /F /A /Q \\?\%1</p>
<p>RD /S /Q \\?\%1<br />
然后要删那个文件就把那个文件拖进去即可&#8230;.</p>
<p>但是又遇到问题了&#8230;有一个顽固的&#8230;PRN.asp;.jpg 拖进去也删不掉&#8230;.</p>
<p>不过没问题 这个也可以删&#8230;先把这个文件的文件夹里的其他的文件备份&#8230;</p>
<p>然后把文件夹拖过去&#8230;^_^ 删了吧&#8230;</p>
<p>然后把备份的文件 拷回去 ok了</p>
<h2  class="related_post_title">相关博文</h2><ul class="related_post"><li>2010年05月23日 -- <a href="http://www.5bay.cn/server-building/rsyncxiangjie.html" title="Rsync详解">Rsync详解</a> (0)</li><li>2010年07月28日 -- <a href="http://www.5bay.cn/server-building/aspeaojie.html" title="ASP防注入新方式，希望对大家是有用的">ASP防注入新方式，希望对大家是有用的</a> (0)</li><li>2010年05月23日 -- <a href="http://www.5bay.cn/server-building/mysqlyouhuajiquanwensousuo.html" title="mysql优化及全文搜索">mysql优化及全文搜索</a> (0)</li><li>2011年06月29日 -- <a href="http://www.5bay.cn/android%e7%ac%94%e8%ae%b0/androidzaixiankaifagongjuappinventor.html" title="Android在线开发工具 App Inventor">Android在线开发工具 App Inventor</a> (0)</li><li>2011年06月29日 -- <a href="http://www.5bay.cn/me/kaiyuanruanjiandeyinglimoshi.html" title="开源软件的盈利模式">开源软件的盈利模式</a> (0)</li><li>2011年06月29日 -- <a href="http://www.5bay.cn/game-development/zishenshejishitonyventricejiexishoujiyouxikaifadesigecengci.html" title="资深设计师Tony Ventrice解析手机游戏开发的四个层次">资深设计师Tony Ventrice解析手机游戏开发的四个层次</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/phpeecketee.html" title="PHP和Socket简介">PHP和Socket简介</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/peeeeee.html" title="深入探讨PHP中的内存管理问题">深入探讨PHP中的内存管理问题</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajaxeeee.html" title="Ajax的工作原理">Ajax的工作原理</a> (1)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajax.html" title="AJAX的各种控件和类库">AJAX的各种控件和类库</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/eesoneeajaxeehuai.html" title="基于JSON的高级AJAX开发技术">基于JSON的高级AJAX开发技术</a> (0)</li><li>2010年05月23日 -- <a href="http://www.5bay.cn/server-building/eacceleratoryumemcachedequbieyuyongtu.html" title="eAccelerator与memcache的区别与用途">eAccelerator与memcache的区别与用途</a> (2)</li><li>2008年10月17日 -- <a href="http://www.5bay.cn/game-development/%E6%B8%B8%E6%88%8F%E6%95%B0%E5%80%BC%E5%85%AC%E5%BC%8F%E7%9A%84%E8%A1%A8%E8%B1%A1%E4%B8%8E%E6%9C%AC%E8%B4%A8.html" title="游戏数值公式的表象与本质">游戏数值公式的表象与本质</a> (0)</li><li>2010年07月28日 -- <a href="http://www.5bay.cn/server-building/eeeeee389.html" title="无需输入密码登陆3389">无需输入密码登陆3389</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/eejaxeeeeee.html" title="使用Ajax时的十个常犯的错误">使用Ajax时的十个常犯的错误</a> (0)</li></ul>
	标签Tags：<a href="http://www.5bay.cn/tag/asp" title="ASP" rel="tag">ASP</a>, <a href="http://www.5bay.cn/tag/%E4%BB%A3%E7%A0%81" title="代码" rel="tag">代码</a>, <a href="http://www.5bay.cn/tag/%E5%B1%9E%E6%80%A7" title="属性" rel="tag">属性</a>, <a href="http://www.5bay.cn/tag/%E5%B7%A5%E5%85%B7" title="工具" rel="tag">工具</a>, <a href="http://www.5bay.cn/tag/%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F" title="操作系统" rel="tag">操作系统</a>, <a href="http://www.5bay.cn/category/server-building" title="服务器构建&amp;安全" rel="tag">服务器构建&amp;安全</a>, <a href="http://www.5bay.cn/tag/%E7%B3%BB%E7%BB%9F" title="系统" rel="tag">系统</a>, <a href="http://www.5bay.cn/tag/%E7%BD%91%E7%AB%99" title="网站" rel="tag">网站</a>, <a href="http://www.5bay.cn/tag/%E9%9A%90%E8%97%8F" title="隐藏" rel="tag">隐藏</a><br />
]]></content:encoded>
			<wfw:commentRss>http://www.5bay.cn/server-building/eeprn-asp-jpg.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AJAX的各种控件和类库</title>
		<link>http://www.5bay.cn/network-programming/ajax.html</link>
		<comments>http://www.5bay.cn/network-programming/ajax.html#comments</comments>
		<pubDate>Sun, 25 Jul 2010 16:49:49 +0000</pubDate>
		<dc:creator>江小邪</dc:creator>
				<category><![CDATA[JavaScript&Ajax]]></category>
		<category><![CDATA[网络编程]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[ASP]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[div]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[js]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[xml]]></category>
		<category><![CDATA[xmlhttp]]></category>
		<category><![CDATA[人]]></category>
		<category><![CDATA[代码]]></category>
		<category><![CDATA[区别]]></category>
		<category><![CDATA[对象]]></category>
		<category><![CDATA[属性]]></category>
		<category><![CDATA[接口]]></category>
		<category><![CDATA[数据]]></category>
		<category><![CDATA[方法]]></category>
		<category><![CDATA[浏览器]]></category>
		<category><![CDATA[类]]></category>
		<category><![CDATA[节点]]></category>
		<category><![CDATA[获取]]></category>
		<category><![CDATA[错误]]></category>
		<category><![CDATA[页面]]></category>

		<guid isPermaLink="false">http://www.5bay.cn/?p=480</guid>
		<description><![CDATA[<a href="http://www.5bay.cn/network-programming/ajax.html"><img align="left" hspace="5" width="150" height="150" src="http://www.5bay.cn/wp-content/plugins/thumbnail-for-excerpts/tfe_no_thumb.png" class="alignleft wp-post-image tfe" alt="" title="" /></a>Ajax控件和类库现在真的太多了，不知不觉中增加了Ajax的神秘性和复杂性，看到版内很多人为此费解和伤神，决定发此贴谈谈本人对Ajax的观点，希望能让大家对Ajax有一个本质的认识。 　　观点一：Ajax和服务器端技术毫不相关 　　严格的说，与传统web开发相比，Ajax是完完全全的客户端技术。由于很多控件封装了客户端和服务器端的通信过程，因此很多问题也因通信而起。事实上，不论何种Ajax技术，服务器端都是返回的一个纯文本流，再由客户端来处理这个文本。这段文本可以是xml格式，也可以是一个Html片段，也可以是一段JavaScript脚本，或者仅是一个字符串。服务器端仅仅是作为一个数据接口，客户端使用XMLHttpRequest对象来请求这个页面，服务器端在页面内写入结果文本，这个过程和普通的web开发没有任何区别。所不同的只是，客户端在异步获取结果后，不是直接显示在页面，而是由客户端的Javascript脚本处理后再显示在页面。至于各种控件所谓的能返回DataSet对象，Date对象，或者其他的数据类型，都是封装了这个处理过程的结果。 　　观点二：DOM模型是Ajax最本质的技术 　　之所以没有把XMLHttpRequest列为最本质的技术，因为本人觉得它实在是太简单了，它只是可以让浏览器在后台请求一个页面，并将其内容交给JavaScript处理。真正的核心应该是：DOM模型，即文档对象模型。在DOM模型里，Html标记都被认为是一个对象，例如：div对象，table对象等等。DOM模型就规定了这些对象所具有的属性、方法和事件。通过这些性质，可以对一个已经显示于浏览器的页面进行内容的修改，例如增加节点、修改节点位置，删除节点等等。而不仅仅是一个innerHTML属性这么简单，虽然这是一个很有用的属性。 　　观点三：在使用Ajax控件前理解它们的实现 　　使用Ajax控件的确可以提高效率，但如果你空中楼阁般使用控件，那就得不偿失了。从一个控件换到另外一个控件又会有一个漫长的学习曲线。所以应该从底层了解其，况且Ajax实在不是什么高深的技术。其实任何东西的最底层其实都是简单的，但如果封装了这些底层的东西，事情会变得复杂和难以理解。以Asp.net为例，它的定制特性可以使得只要在方法前加上[ajax method]类似这样的标志就可以称为一个异步方法，相信这使得Asp.net的Ajax开发显得更加“高效”或者是“神秘”，而更多的事情则被封装了。同样记住一条，任何对服务器端的请求仅仅是返回纯文本，我们不一定要依赖于封装好的处理过程，而完全可以自己来实现。 　　观点四：学好JavaScript 　　在大多数人看来，JavaScript总不是那么一种正规的语言，随便copy一段就碰巧能运行，学过c之类的人，一看也能看懂，而且在浏览器中常常有脚本错误提示，所以潜意识觉得总不能付之以大任。事实上，要学好Ajax，这就完全是一种错误的看法。javascript作为一种脚本语言，其语法的确不是很严格，但并不妨碍其完成诸多复杂的任务，没有JavaScript，就没有Ajax。所以本人强烈建议，学Ajax前，一定要好好研究一番JavaScript，一般来讲，如果能顺利看懂prototype框架的代码（如：prototype-1.3.1.js），你的JavaScript水平就基本过关了。同时对DOM模型也可以算有一个基本的了解。 　　观点五：Ajax点缀：CSS 　　用JavaScript控制CSS其实很简单，基本上每个DOM对象都有一个style对象，只要把css属性里的”-”去掉，并让随后的字母变为大写就可以作为属性使用了，例如：element.style.backgroundColor=”#f00&#8243;;在css是：选择符 {background-color:#f00} 　　一口气说这么多，希望对大家有点用处。 相关博文2010年07月26日 -- XMLHTTP对象封装技术 (0)2010年07月26日 -- 基于JSON的高级AJAX开发技术 (0)2010年07月26日 -- Ajax的工作原理 (1)2010年07月26日 -- 使用Ajax时的十个常犯的错误 (0)2010年07月26日 -- ajax的缺点 (0)2010年07月26日 -- 了解Ajax中的Get和Post (0)2010年07月26日 -- PHP和Socket简介 (0)2010年05月23日 -- 《高性能网站建设指南》读书笔记 (0)2010年07月26日 -- AJAX应用程序开发七宗罪 (0)2010年07月26日 -- AJAX初学:IE缓存页面的问题 (0)2010年07月26日 -- ajax基础知识:js事件触发大全 (0)2010年07月26日 -- PHP安全之数据过滤 (0)2010年05月23日 -- mysql优化及全文搜索 (0)2010年05月23日 -- [...]]]></description>
			<content:encoded><![CDATA[<p>Ajax控件和类库现在真的太多了，不知不觉中增加了Ajax的神秘性和复杂性，看到版内很多人为此费解和伤神，决定发此贴谈谈本人对Ajax的观点，希望能让大家对Ajax有一个本质的认识。 </p>
<p>　　观点一：Ajax和服务器端技术毫不相关 </p>
<p>　　严格的说，与传统web开发相比，Ajax是完完全全的客户端技术。由于很多控件封装了客户端和服务器端的通信过程，因此很多问题也因通信而起。事实上，不论何种Ajax技术，服务器端都是返回的一个纯文本流，再由客户端来处理这个文本。这段文本可以是xml格式，也可以是一个Html片段，也可以是一段JavaScript脚本，或者仅是一个字符串。服务器端仅仅是作为一个数据接口，客户端使用XMLHttpRequest对象来请求这个页面，服务器端在页面内写入结果文本，这个过程和普通的web开发没有任何区别。所不同的只是，客户端在异步获取结果后，不是直接显示在页面，而是由客户端的Javascript脚本处理后再显示在页面。至于各种控件所谓的能返回DataSet对象，Date对象，或者其他的数据类型，都是封装了这个处理过程的结果。 </p>
<p>　　观点二：DOM模型是Ajax最本质的技术 </p>
<p>　　之所以没有把XMLHttpRequest列为最本质的技术，因为本人觉得它实在是太简单了，它只是可以让浏览器在后台请求一个页面，并将其内容交给JavaScript处理。真正的核心应该是：DOM模型，即文档对象模型。在DOM模型里，Html标记都被认为是一个对象，例如：div对象，table对象等等。DOM模型就规定了这些对象所具有的属性、方法和事件。通过这些性质，可以对一个已经显示于浏览器的页面进行内容的修改，例如增加节点、修改节点位置，删除节点等等。而不仅仅是一个innerHTML属性这么简单，虽然这是一个很有用的属性。 </p>
<p>　　观点三：在使用Ajax控件前理解它们的实现 </p>
<p>　　使用Ajax控件的确可以提高效率，但如果你空中楼阁般使用控件，那就得不偿失了。从一个控件换到另外一个控件又会有一个漫长的学习曲线。所以应该从底层了解其，况且Ajax实在不是什么高深的技术。其实任何东西的最底层其实都是简单的，但如果封装了这些底层的东西，事情会变得复杂和难以理解。以Asp.net为例，它的定制特性可以使得只要在方法前加上[ajax method]类似这样的标志就可以称为一个异步方法，相信这使得Asp.net的Ajax开发显得更加“高效”或者是“神秘”，而更多的事情则被封装了。同样记住一条，任何对服务器端的请求仅仅是返回纯文本，我们不一定要依赖于封装好的处理过程，而完全可以自己来实现。 </p>
<p>　　观点四：学好JavaScript </p>
<p>　　在大多数人看来，JavaScript总不是那么一种正规的语言，随便copy一段就碰巧能运行，学过c之类的人，一看也能看懂，而且在浏览器中常常有脚本错误提示，所以潜意识觉得总不能付之以大任。事实上，要学好Ajax，这就完全是一种错误的看法。javascript作为一种脚本语言，其语法的确不是很严格，但并不妨碍其完成诸多复杂的任务，没有JavaScript，就没有Ajax。所以本人强烈建议，学Ajax前，一定要好好研究一番JavaScript，一般来讲，如果能顺利看懂prototype框架的代码（如：prototype-1.3.1.js），你的JavaScript水平就基本过关了。同时对DOM模型也可以算有一个基本的了解。 </p>
<p>　　观点五：Ajax点缀：CSS </p>
<p>　　用JavaScript控制CSS其实很简单，基本上每个DOM对象都有一个style对象，只要把css属性里的”-”去掉，并让随后的字母变为大写就可以作为属性使用了，例如：element.style.backgroundColor=”#f00&#8243;;在css是：选择符 {background-color:#f00} </p>
<p>　　一口气说这么多，希望对大家有点用处。 </p>
<h2  class="related_post_title">相关博文</h2><ul class="related_post"><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/xmlhttpe.html" title="XMLHTTP对象封装技术">XMLHTTP对象封装技术</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/eesoneeajaxeehuai.html" title="基于JSON的高级AJAX开发技术">基于JSON的高级AJAX开发技术</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajaxeeee.html" title="Ajax的工作原理">Ajax的工作原理</a> (1)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/eejaxeeeeee.html" title="使用Ajax时的十个常犯的错误">使用Ajax时的十个常犯的错误</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajaxxuan.html" title="ajax的缺点">ajax的缺点</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/eejaxeeetpit.html" title="了解Ajax中的Get和Post ">了解Ajax中的Get和Post </a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/phpeecketee.html" title="PHP和Socket简介">PHP和Socket简介</a> (0)</li><li>2010年05月23日 -- <a href="http://www.5bay.cn/server-building/gaoxingnengwangzhanjianshezhinandushubiji.html" title="《高性能网站建设指南》读书笔记">《高性能网站建设指南》读书笔记</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajaxeeaoe.html" title="AJAX应用程序开发七宗罪">AJAX应用程序开发七宗罪</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajaxeeieeeeeting.html" title="AJAX初学:IE缓存页面的问题">AJAX初学:IE缓存页面的问题</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajaxeeeeseeao.html" title="ajax基础知识:js事件触发大全">ajax基础知识:js事件触发大全</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/phpeezhanchang.html" title="PHP安全之数据过滤">PHP安全之数据过滤</a> (0)</li><li>2010年05月23日 -- <a href="http://www.5bay.cn/server-building/mysqlyouhuajiquanwensousuo.html" title="mysql优化及全文搜索">mysql优化及全文搜索</a> (0)</li><li>2010年05月23日 -- <a href="http://www.5bay.cn/network-programming/phpzhongdememcachehanshukumemcachefunctions.html" title="PHP中的Memcache函数库（Memcache Functions）">PHP中的Memcache函数库（Memcache Functions）</a> (0)</li><li>2010年07月28日 -- <a href="http://www.5bay.cn/server-building/aspeaojie.html" title="ASP防注入新方式，希望对大家是有用的">ASP防注入新方式，希望对大家是有用的</a> (0)</li></ul>
	标签Tags：<a href="http://www.5bay.cn/tag/ajax" title="ajax" rel="tag">ajax</a>, <a href="http://www.5bay.cn/tag/asp" title="ASP" rel="tag">ASP</a>, <a href="http://www.5bay.cn/tag/aspnet" title="asp.net" rel="tag">asp.net</a>, <a href="http://www.5bay.cn/tag/css" title="css" rel="tag">css</a>, <a href="http://www.5bay.cn/tag/div" title="div" rel="tag">div</a>, <a href="http://www.5bay.cn/tag/html" title="html" rel="tag">html</a>, <a href="http://www.5bay.cn/tag/javascript" title="javascript" rel="tag">javascript</a>, <a href="http://www.5bay.cn/category/network-programming/javascript-ajax" title="JavaScript&amp;Ajax" rel="tag">JavaScript&amp;Ajax</a>, <a href="http://www.5bay.cn/tag/js" title="js" rel="tag">js</a>, <a href="http://www.5bay.cn/tag/web" title="web" rel="tag">web</a>, <a href="http://www.5bay.cn/tag/xml" title="xml" rel="tag">xml</a>, <a href="http://www.5bay.cn/tag/xmlhttp" title="xmlhttp" rel="tag">xmlhttp</a>, <a href="http://www.5bay.cn/tag/%E4%BA%BA" title="人" rel="tag">人</a>, <a href="http://www.5bay.cn/tag/%E4%BB%A3%E7%A0%81" title="代码" rel="tag">代码</a>, <a href="http://www.5bay.cn/tag/%E5%8C%BA%E5%88%AB" title="区别" rel="tag">区别</a>, <a href="http://www.5bay.cn/tag/%E5%AF%B9%E8%B1%A1" title="对象" rel="tag">对象</a>, <a href="http://www.5bay.cn/tag/%E5%B1%9E%E6%80%A7" title="属性" rel="tag">属性</a>, <a href="http://www.5bay.cn/tag/%E6%8E%A5%E5%8F%A3" title="接口" rel="tag">接口</a>, <a href="http://www.5bay.cn/tag/%E6%95%B0%E6%8D%AE" title="数据" rel="tag">数据</a>, <a href="http://www.5bay.cn/tag/%E6%96%B9%E6%B3%95" title="方法" rel="tag">方法</a>, <a href="http://www.5bay.cn/tag/%E6%B5%8F%E8%A7%88%E5%99%A8" title="浏览器" rel="tag">浏览器</a>, <a href="http://www.5bay.cn/tag/%E7%B1%BB" title="类" rel="tag">类</a>, <a href="http://www.5bay.cn/category/network-programming" title="网络编程" rel="tag">网络编程</a>, <a href="http://www.5bay.cn/tag/%E8%8A%82%E7%82%B9" title="节点" rel="tag">节点</a>, <a href="http://www.5bay.cn/tag/%E8%8E%B7%E5%8F%96" title="获取" rel="tag">获取</a>, <a href="http://www.5bay.cn/tag/%E9%94%99%E8%AF%AF" title="错误" rel="tag">错误</a>, <a href="http://www.5bay.cn/tag/%E9%A1%B5%E9%9D%A2" title="页面" rel="tag">页面</a><br />
]]></content:encoded>
			<wfw:commentRss>http://www.5bay.cn/network-programming/ajax.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>了解Ajax中的Get和Post</title>
		<link>http://www.5bay.cn/network-programming/eejaxeeetpit.html</link>
		<comments>http://www.5bay.cn/network-programming/eejaxeeetpit.html#comments</comments>
		<pubDate>Sun, 25 Jul 2010 16:45:02 +0000</pubDate>
		<dc:creator>江小邪</dc:creator>
				<category><![CDATA[JavaScript&Ajax]]></category>
		<category><![CDATA[网络编程]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[ASP]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[status]]></category>
		<category><![CDATA[url]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[xml]]></category>
		<category><![CDATA[xmlhttp]]></category>
		<category><![CDATA[对象]]></category>
		<category><![CDATA[数据]]></category>
		<category><![CDATA[方法]]></category>

		<guid isPermaLink="false">http://www.5bay.cn/?p=472</guid>
		<description><![CDATA[<a href="http://www.5bay.cn/network-programming/eejaxeeetpit.html"><img align="left" hspace="5" width="150" height="150" src="http://www.5bay.cn/wp-content/plugins/thumbnail-for-excerpts/tfe_no_thumb.png" class="alignleft wp-post-image tfe" alt="" title="" /></a>Get方式: 作用:可传送简单数据 大小:url最大长度是2083 bytes,可以用于GET传递数据的长度是2048 bytes 包含体:数据追加到url中发送,也就是http的header传送 Post方式: 作用:可传送简单复杂数据 大小:web.config里限制 包含体:数据在http请求的实体内容里传送 Ajax用Post模式传送数据.需注意： 1.设置header的Context-Type为application/x-www-form-urlencode确保服务器知道实体中有参数变量.通常使用XmlHttpRequest对象的SetRequestHeader(“Context-Type”,”application/x-www-form-urlencoded;”) 2.参数是名/值一一对应的键值对,每对值用&#038;号隔开.如 name=abc&#038;sex=man&#038;age=18. 3.参数在Send(参数)方法中发送 4.服务器端请求参数区分Get与Post.例如asp.net中以Request.Form["name"]对实体中的参数请求.这时url参数请求Request.QueryString["name"]将引发异常]]></description>
			<content:encoded><![CDATA[<p>Get方式:</p>
<p>作用:可传送简单数据<br />
大小:url最大长度是2083 bytes,可以用于GET传递数据的长度是2048 bytes<br />
包含体:数据追加到url中发送,也就是http的header传送</p>
<p>Post方式:</p>
<p>作用:可传送简单复杂数据<br />
大小:web.config里限制<br />
包含体:数据在http请求的实体内容里传送<br />
<span id="more-472"></span><br />
Ajax用Post模式传送数据.需注意：</p>
<p>1.设置header的Context-Type为application/x-www-form-urlencode确保服务器知道实体中有参数变量.通常使用XmlHttpRequest对象的SetRequestHeader(“Context-Type”,”application/x-www-form-urlencoded;”)<br />
2.参数是名/值一一对应的键值对,每对值用&#038;号隔开.如 name=abc&#038;sex=man&#038;age=18.<br />
3.参数在Send(参数)方法中发送<br />
4.服务器端请求参数区分Get与Post.例如asp.net中以Request.Form["name"]对实体中的参数请求.这时url参数请求Request.QueryString["name"]将引发异常</p>
<p><<a href="http://www.5bay.cn/tag/javascript" class="st_tag internal_tag" rel="tag" title="标签 javascript 下的日志">javascript</a> language="<a href="http://www.5bay.cn/tag/javascript" class="st_tag internal_tag" rel="tag" title="标签 javascript 下的日志">javascript</a>><br />
function StateEvent()<br />
{<br />
if(XmlHttpObject.readyState == 4)<br />
{<br />
if(XmlHttpObject.<a href="http://www.5bay.cn/tag/status" class="st_tag internal_tag" rel="tag" title="标签 status 下的日志">status</a> == 200)<br />
{<br />
//<a href="http://www.5bay.cn/tag/code" class="st_tag internal_tag" rel="tag" title="标签 code 下的日志">code</a><br />
}<br />
}<br />
}</p>
<p>function CreateXmlHttp()<br />
{<br />
if(window.ActiveXObject)<br />
{<br />
return new ActiveXObject(“Microsoft.<a href="http://www.5bay.cn/tag/xmlhttp" class="st_tag internal_tag" rel="tag" title="标签 xmlhttp 下的日志">XMLHTTP</a>”);<br />
}<br />
else if (window.XMLHttpRequest)<br />
{<br />
return new XmlHttpRequest();<br />
}<br />
}</p>
<p>function Start()<br />
{<br />
var ParamString = “name=abc&#038;sex=man&#038;age=18&#8243;;<br />
var XmlHttpObject = CreateXmlHttp();<br />
XmlHttpObject.onreadystatechange = StateEvent;<br />
XmlHttpObject.open(“post”,”test.aspx”,true);<br />
XmlHttpObject.setRequestHeader(“Content-Type”,”application/x-www-form-urlencoded;”); //设置服务器响应请求体参数<br />
XmlHttpObject.send(ParamString);<br />
}<br />
</script></p>
<h2  class="related_post_title">相关博文</h2><ul class="related_post"><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajaxeeee.html" title="Ajax的工作原理">Ajax的工作原理</a> (1)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajax.html" title="AJAX的各种控件和类库">AJAX的各种控件和类库</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/eejaxeeeeee.html" title="使用Ajax时的十个常犯的错误">使用Ajax时的十个常犯的错误</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/xmlhttpe.html" title="XMLHTTP对象封装技术">XMLHTTP对象封装技术</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/eesoneeajaxeehuai.html" title="基于JSON的高级AJAX开发技术">基于JSON的高级AJAX开发技术</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajaxeeieeeeeting.html" title="AJAX初学:IE缓存页面的问题">AJAX初学:IE缓存页面的问题</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajaxxuan.html" title="ajax的缺点">ajax的缺点</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/eeeeeeee.html" title="最令PHP初学者头痛的十四个问题">最令PHP初学者头痛的十四个问题</a> (0)</li><li>2010年05月23日 -- <a href="http://www.5bay.cn/server-building/gaoxingnengwangzhanjianshezhinandushubiji.html" title="《高性能网站建设指南》读书笔记">《高性能网站建设指南》读书笔记</a> (0)</li><li>2010年07月28日 -- <a href="http://www.5bay.cn/server-building/aspeaojie.html" title="ASP防注入新方式，希望对大家是有用的">ASP防注入新方式，希望对大家是有用的</a> (0)</li><li>2010年07月28日 -- <a href="http://www.5bay.cn/server-building/webshelleechueeee.html" title="Webshell下破解计算机管理员密码">Webshell下破解计算机管理员密码</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajaxeeaoe.html" title="AJAX应用程序开发七宗罪">AJAX应用程序开发七宗罪</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajaxeeeeseeao.html" title="ajax基础知识:js事件触发大全">ajax基础知识:js事件触发大全</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/phpeezhanchang.html" title="PHP安全之数据过滤">PHP安全之数据过滤</a> (0)</li><li>2010年05月23日 -- <a href="http://www.5bay.cn/network-programming/phpzhongdememcachehanshukumemcachefunctions.html" title="PHP中的Memcache函数库（Memcache Functions）">PHP中的Memcache函数库（Memcache Functions）</a> (0)</li></ul>
	标签Tags：<a href="http://www.5bay.cn/tag/ajax" title="ajax" rel="tag">ajax</a>, <a href="http://www.5bay.cn/tag/asp" title="ASP" rel="tag">ASP</a>, <a href="http://www.5bay.cn/tag/aspnet" title="asp.net" rel="tag">asp.net</a>, <a href="http://www.5bay.cn/tag/code" title="code" rel="tag">code</a>, <a href="http://www.5bay.cn/tag/javascript" title="javascript" rel="tag">javascript</a>, <a href="http://www.5bay.cn/category/network-programming/javascript-ajax" title="JavaScript&amp;Ajax" rel="tag">JavaScript&amp;Ajax</a>, <a href="http://www.5bay.cn/tag/status" title="status" rel="tag">status</a>, <a href="http://www.5bay.cn/tag/url" title="url" rel="tag">url</a>, <a href="http://www.5bay.cn/tag/web" title="web" rel="tag">web</a>, <a href="http://www.5bay.cn/tag/xml" title="xml" rel="tag">xml</a>, <a href="http://www.5bay.cn/tag/xmlhttp" title="xmlhttp" rel="tag">xmlhttp</a>, <a href="http://www.5bay.cn/tag/%E5%AF%B9%E8%B1%A1" title="对象" rel="tag">对象</a>, <a href="http://www.5bay.cn/tag/%E6%95%B0%E6%8D%AE" title="数据" rel="tag">数据</a>, <a href="http://www.5bay.cn/tag/%E6%96%B9%E6%B3%95" title="方法" rel="tag">方法</a>, <a href="http://www.5bay.cn/category/network-programming" title="网络编程" rel="tag">网络编程</a><br />
]]></content:encoded>
			<wfw:commentRss>http://www.5bay.cn/network-programming/eejaxeeetpit.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>nginx 通过user-agent判断手机终端</title>
		<link>http://www.5bay.cn/website/nginxtongguouser-agentpanduanshoujizhongduan.html</link>
		<comments>http://www.5bay.cn/website/nginxtongguouser-agentpanduanshoujizhongduan.html#comments</comments>
		<pubDate>Sat, 22 May 2010 21:12:45 +0000</pubDate>
		<dc:creator>江小邪</dc:creator>
				<category><![CDATA[网站建设]]></category>
		<category><![CDATA[ASP]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[path]]></category>
		<category><![CDATA[wap]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[判断]]></category>

		<guid isPermaLink="false">http://www.5bay.cn/?p=354</guid>
		<description><![CDATA[<a href="http://www.5bay.cn/website/nginxtongguouser-agentpanduanshoujizhongduan.html"><img align="left" hspace="5" width="150" height="150" src="http://www.5bay.cn/wp-content/plugins/thumbnail-for-excerpts/tfe_no_thumb.png" class="alignleft wp-post-image tfe" alt="" title="" /></a>user-agent 收集： http://www.developershome.com/wap/detection/detection.asp?page=userAgentHeader http://search.cpan.org/~cmanley/Mobile-UserAgent-1.05/lib/Mobile/UserAgent.pm http://www.zytrax.com/tech/web/mobile_ids.html http://en.wikipedia.org/wiki/List_of_user_agents_for_mobile_phones nginx location = / { root /var/www/path; if ($http_user_agent ~* “Nokia”) { rewrite . /index.html break; } if ($http_user_agent ~* “Mobile”) { rewrite . /index.html break; } if ($http_user_agent ~* “SAMSUNG”) { rewrite . /index.html break; } } if ($http_user_agent ~* “SonyEricsson”) { rewrite . /index.html break; } if [...]]]></description>
			<content:encoded><![CDATA[<p>user-agent 收集：</p>
<p>http://www.developershome.com/<a href="http://www.5bay.cn/tag/wap" class="st_tag internal_tag" rel="tag" title="标签 wap 下的日志">wap</a>/detection/detection.<a href="http://www.5bay.cn/tag/asp" class="st_tag internal_tag" rel="tag" title="标签 ASP 下的日志">asp</a>?page=userAgentHeader</p>
<p>http://search.cpan.org/~cmanley/Mobile-UserAgent-1.05/lib/Mobile/UserAgent.pm</p>
<p>http://www.zytrax.com/tech/<a href="http://www.5bay.cn/tag/web" class="st_tag internal_tag" rel="tag" title="标签 web 下的日志">web</a>/mobile_ids.<a href="http://www.5bay.cn/tag/html" class="st_tag internal_tag" rel="tag" title="标签 html 下的日志">html</a></p>
<p>http://en.wikipedia.org/wiki/List_of_user_agents_for_mobile_phones</p>
<p>nginx</p>
<p>location = / {</p>
<p>root /var/www/<a href="http://www.5bay.cn/tag/path" class="st_tag internal_tag" rel="tag" title="标签 path 下的日志">path</a>;<br />
if ($http_user_agent ~* “Nokia”) { rewrite . /index.html break; }</p>
<p>if ($http_user_agent ~* “Mobile”) { rewrite . /index.html break; }</p>
<p>if ($http_user_agent ~* “SAMSUNG”) { rewrite . /index.html break; } }</p>
<p>if ($http_user_agent ~* “SonyEricsson”) { rewrite . /index.html break; }<br />
if ($http_user_agent ~* “MOT”) { rewrite . /index.html break; } }<br />
if ($http_user_agent ~* “BlackBerry”) { rewrite . /index.html break; }<br />
if ($http_user_agent ~* “LG”) { rewrite . /index.html break; } }<br />
if ($http_user_agent ~* “HTC”) { rewrite . /index.html break; }</p>
<p>if ($http_user_agent ~* “J2ME”) { rewrite . /index.html break; }<br />
if ($http_user_agent ~* “Opera Mini”) { rewrite . /index.html break; } }<br />
index index.html;<br />
}</p>
<h2  class="related_post_title">相关博文</h2><ul class="related_post"><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajax.html" title="AJAX的各种控件和类库">AJAX的各种控件和类库</a> (0)</li><li>2010年05月23日 -- <a href="http://www.5bay.cn/server-building/nginxderewriteguize.html" title="nginx的rewrite规则">nginx的rewrite规则</a> (1)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/eejaxeeeeee.html" title="使用Ajax时的十个常犯的错误">使用Ajax时的十个常犯的错误</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/phpeezhanchang.html" title="PHP安全之数据过滤">PHP安全之数据过滤</a> (0)</li><li>2010年05月23日 -- <a href="http://www.5bay.cn/server-building/rsyncxiangjie.html" title="Rsync详解">Rsync详解</a> (0)</li><li>2010年07月28日 -- <a href="http://www.5bay.cn/server-building/webshelleechueeee.html" title="Webshell下破解计算机管理员密码">Webshell下破解计算机管理员密码</a> (0)</li><li>2010年07月28日 -- <a href="http://www.5bay.cn/server-building/aoeempirebakeebshell.html" title="帝国备份王(Empirebak)拿webshell">帝国备份王(Empirebak)拿webshell</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/eeeeeeee.html" title="最令PHP初学者头痛的十四个问题">最令PHP初学者头痛的十四个问题</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajaxeeee.html" title="Ajax的工作原理">Ajax的工作原理</a> (1)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/eejaxeeetpit.html" title="了解Ajax中的Get和Post ">了解Ajax中的Get和Post </a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajaxxuan.html" title="ajax的缺点">ajax的缺点</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/eesoneeajaxeehuai.html" title="基于JSON的高级AJAX开发技术">基于JSON的高级AJAX开发技术</a> (0)</li><li>2010年07月22日 -- <a href="http://www.5bay.cn/me/csseeeeyao.html" title="CSS 中的太极拳口诀">CSS 中的太极拳口诀</a> (0)</li><li>2010年05月23日 -- <a href="http://www.5bay.cn/server-building/gezhonglanqideuseragent.html" title="各种浏览器的userAgent">各种浏览器的userAgent</a> (0)</li><li>2010年05月23日 -- <a href="http://www.5bay.cn/network-programming/tupianlunhuanleiie7opffchromeceshitongguo.html" title="图片轮换类，IE7、OP、FF、Chrome测试通过">图片轮换类，IE7、OP、FF、Chrome测试通过</a> (2)</li></ul>
	标签Tags：<a href="http://www.5bay.cn/tag/asp" title="ASP" rel="tag">ASP</a>, <a href="http://www.5bay.cn/tag/css" title="css" rel="tag">css</a>, <a href="http://www.5bay.cn/tag/html" title="html" rel="tag">html</a>, <a href="http://www.5bay.cn/tag/path" title="path" rel="tag">path</a>, <a href="http://www.5bay.cn/tag/wap" title="wap" rel="tag">wap</a>, <a href="http://www.5bay.cn/tag/web" title="web" rel="tag">web</a>, <a href="http://www.5bay.cn/tag/%E5%88%A4%E6%96%AD" title="判断" rel="tag">判断</a>, <a href="http://www.5bay.cn/category/website" title="网站建设" rel="tag">网站建设</a><br />
]]></content:encoded>
			<wfw:commentRss>http://www.5bay.cn/website/nginxtongguouser-agentpanduanshoujizhongduan.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>用正则解析图片地址,并利用XMLHTTP组件将其保存</title>
		<link>http://www.5bay.cn/network-programming/asp/%E7%94%A8%E6%AD%A3%E5%88%99%E8%A7%A3%E6%9E%90%E5%9B%BE%E7%89%87%E5%9C%B0%E5%9D%80%E5%B9%B6%E5%88%A9%E7%94%A8xmlhttp%E7%BB%84%E4%BB%B6%E5%B0%86%E5%85%B6%E4%BF%9D%E5%AD%98.html</link>
		<comments>http://www.5bay.cn/network-programming/asp/%E7%94%A8%E6%AD%A3%E5%88%99%E8%A7%A3%E6%9E%90%E5%9B%BE%E7%89%87%E5%9C%B0%E5%9D%80%E5%B9%B6%E5%88%A9%E7%94%A8xmlhttp%E7%BB%84%E4%BB%B6%E5%B0%86%E5%85%B6%E4%BF%9D%E5%AD%98.html#comments</comments>
		<pubDate>Sat, 29 Dec 2007 19:49:54 +0000</pubDate>
		<dc:creator>江小邪</dc:creator>
				<category><![CDATA[ASP]]></category>
		<category><![CDATA[xmlhttp]]></category>
		<category><![CDATA[图片地址]]></category>
		<category><![CDATA[正则解析]]></category>
		<category><![CDATA[组件]]></category>

		<guid isPermaLink="false">?p=272</guid>
		<description><![CDATA[<a href="http://www.5bay.cn/network-programming/asp/%E7%94%A8%E6%AD%A3%E5%88%99%E8%A7%A3%E6%9E%90%E5%9B%BE%E7%89%87%E5%9C%B0%E5%9D%80%E5%B9%B6%E5%88%A9%E7%94%A8xmlhttp%E7%BB%84%E4%BB%B6%E5%B0%86%E5%85%B6%E4%BF%9D%E5%AD%98.html"><img align="left" hspace="5" width="150" height="150" src="http://www.5bay.cn/wp-content/plugins/thumbnail-for-excerpts/tfe_no_thumb.png" class="alignleft wp-post-image tfe" alt="" title="" /></a>现在基于WEB页的HTML的编辑器在新闻系统，文章系统中用得越来越广，一个网页一粘就可以保持原来的样式，同时图片也可以在这个页中保持。但是在使用过程中，如果所粘贴页中的图片被删除，就会在自己的页面上留下一个大大的“X”，影响美观。以前只好把这个图片保存下来，再重新上传到服务器上，这样实在麻烦。能不能让服务器自动去下载图片保存在服务器并且替换页面上的链接？答案是肯定的。 要实现这个功能需要经过三个步骤： 一，取得原页中的图片的地址。方法很多，可以用分割字符串，也可以用正则匹配。实践证明用正则匹配最为简单。经过分析图片的地址都保存在&#60;img&#62;标签中。我们可以先取得所有这个标签。过程如下： Set objRegExp = New Regexp&#039;设置配置对象 objRegExp.IgnoreCase = True’忽略大小写 objRegExp.Global = True’设置为全文搜索 objRegExp.Pattern = &#34;&#60;img.+?&#62;&#34;&#039;为了确保能准确地取出图片地址所以分为两层配置：首先找到里面的&#60;img&#62;标签，然后再取出里面的图片地址后面的getimgs函数就是实现后一个功能的。 strs=trim(str) Set Matches =objRegExp.Execute(strs)’开始执行配置 For Each Match in Matches RetStr = RetStr &#38;getimgs( Match.Value )’执行第二轮的匹配 Next 所有的图片在里面都是这样的src=&#34;http://图片的地址&#34;，所以可以这样来取得确切的图片地址： function getimgs(str) getimgs=&#34;&#34; Set objRegExp1 = New Regexp objRegExp1.IgnoreCase = True objRegExp1.Global = True objRegExp1.Pattern = &#34;http://.+?&#34;&#34;&#34;’取出里面的地址 set mm=objRegExp1.Execute(str) For Each [...]]]></description>
			<content:encoded><![CDATA[<p>现在基于WEB页的HTML的编辑器在新闻系统，文章系统中用得越来越广，一个网页一粘就可以保持原来的样式，同时图片也可以在这个页中保持。但是在使用过程中，如果所粘贴页中的图片被删除，就会在自己的页面上留下一个大大的“X”，影响美观。以前只好把这个图片保存下来，再重新上传到服务器上，这样实在麻烦。能不能让服务器自动去下载图片保存在服务器并且替换页面上的链接？答案是肯定的。 <span id="more-272"></span><br/>要实现这个功能需要经过三个步骤： <br/>一，取得原页中的图片的地址。方法很多，可以用分割字符串，也可以用正则匹配。实践证明用正则匹配最为简单。经过分析图片的地址都保存在&lt;img&gt;标签中。我们可以先取得所有这个标签。过程如下： <br/>Set objRegExp = New Regexp&#039;设置配置对象 <br/>objRegExp.IgnoreCase = True’忽略大小写 <br/>objRegExp.Global = True’设置为全文搜索 <br/>objRegExp.Pattern = &quot;&lt;img.+?&gt;&quot;&#039;为了确保能准确地取出图片地址所以分为两层配置：首先找到里面的&lt;img&gt;标签，然后再取出里面的图片地址后面的getimgs函数就是实现后一个功能的。 <br/>strs=trim(str) <br/>Set Matches =objRegExp.Execute(strs)’开始执行配置 <br/>For Each Match in Matches <br/>RetStr = RetStr &amp;getimgs( Match.Value )’执行第二轮的匹配 <br/>Next <br/><br/>所有的图片在里面都是这样的src=&quot;http://图片的地址&quot;，所以可以这样来取得确切的图片地址： <br/>function getimgs(str) <br/>getimgs=&quot;&quot; <br/>Set objRegExp1 = New Regexp <br/>objRegExp1.IgnoreCase = True <br/>objRegExp1.Global = True <br/>objRegExp1.Pattern = &quot;http://.+?&quot;&quot;&quot;’取出里面的地址 <br/>set mm=objRegExp1.Execute(str) <br/>For Each Match1 in mm <br/>getimgs=getimgs&amp;&quot;&#124;&#124;&quot;&amp;left(Match1.Value,len(Match1.Value)-1)’把里面的地址串起来备用 <br/>next <br/>end function <br/><br/>取得了所有的图片的地址，我们就可以进行第二步的操作了。 <br/>二，下载图片并保存在服务器上。这个又可以分为两个步骤：一个是取得图片的内容，另一个是保存在服务器上。取得图片的内容是通过下面的函数来实现的： <br/>function getHTTPPage(url) <br/>on error resume next <br/>dim http <br/>set http=<a href="http://www.5bay.cn/tag/server" class="st_tag internal_tag" rel="tag" title="标签 server 下的日志">server</a>.createobject(&quot;MSXML2.XMLHTTP&quot;)‘使用xmlhttp的方法来获得图片的内容 <br/>Http.open &quot;GET&quot;,url,false <br/>Http.send() <br/>if Http.readystate&lt;&gt;4 then <br/>exit function <br/>end if <br/>getHTTPPage=Http.responseBody <br/>set http=nothing <br/>if err.number&lt;&gt;0 then err.Clear <br/>end function <br/>取得了图片的内容要保存，给人一种感觉是用FSO来作就可以了，但实际上不行，这样保存程序就会出错，因为FSO不支持流式的文件，所以我们要调用另一个对象：ADO.STREM。具体的过程如下： <br/>function saveimage(from,tofile) <br/>dim geturl,objStream,imgs <br/>geturl=trim(from) <br/>imgs=gethttppage(geturl)&#039;取得图片的具休内容的过程 <br/>Set objStream = Server.CreateObject(&quot;ADODB.Stream&quot;)&#039;建立ADODB.Stream对象，必须要ADO 2.5以上版本 <br/>objStream.Type =1&#039;以二进制模式打开 <br/>objStream.Open <br/>objstream.write imgs&#039;将字符串内容写入缓冲 <br/>objstream.SaveToFile server.mappath(tofile),2&#039;-将缓冲的内容写入文件 <br/>objstream.Close()&#039;关闭对象 <br/>set objstream=nothing <br/>end function <br/>所以只要用一个循环来把刚才取得的地址中的图片全部保存下来，具体过程如下： <br/>arrimg=split(retstr,&quot;&#124;&#124;&quot;)&#039;分割字串，取得里面地址列表 <br/>allimg=&quot;&quot; <br/>newimg=&quot;&quot; <br/>for i=1 to ubound(arrimg) <br/>if arrimg(i)&lt;&gt;&quot;&quot; and instr(allimg,arrimg(i))&lt;1 then&#039;看这个图片是否已经下载过 <br/>fname=baseurl&amp;cstr(i&amp;mid(arrimg(i),instrrev(arrimg(i),&quot;.&quot;))) <br/>saveimage(arrimg(i),fname)‘保存地址的函数，过程见上面 <br/>allimg=allimg&amp;&quot;&#124;&#124;&quot;&amp;arrimg(i)&#039;把保存下来的图片的地址串回起来，以确定要替换的地址 <br/>newimg=newimg&amp;&quot;&#124;&#124;&quot;&amp;fname&#039;把本地的地址串回起来 <br/>end if <br/>next <br/>第三步就是替换原来的地址了。具体的过程就是下面了： <br/>arrnew=split(newimg,&quot;&#124;&#124;&quot;)&#039;取得原来的图片地址列表 <br/>arrall=split(allimg,&quot;&#124;&#124;&quot;)&#039;取得已经保存下来的图片的地址列表 <br/>for i=1 to ubound(arrnew)&#039;执行循环替换原来的地址 <br/>strs=replace(strs,arrall(i),arrnew(i)) <br/>next <br/>cctv=strs <br/>讲到这里，这个函数的基本过程就是这样了，当然可以对它进行改造就可以实现更多的功能，如：加上图片大小的限制，加上对本地机上的图片下载的限制，以免造成重复下载图片。同时也应该看到这个函数的不足之处是只能处理静态的图片文件，不能适用程序生成的图片。<br/></p>
<h2  class="related_post_title">相关博文</h2><ul class="related_post"><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajax.html" title="AJAX的各种控件和类库">AJAX的各种控件和类库</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/eejaxeeetpit.html" title="了解Ajax中的Get和Post ">了解Ajax中的Get和Post </a> (0)</li><li>2011年06月29日 -- <a href="http://www.5bay.cn/android%e7%ac%94%e8%ae%b0/androidzaixiankaifagongjuappinventor.html" title="Android在线开发工具 App Inventor">Android在线开发工具 App Inventor</a> (0)</li><li>2011年06月29日 -- <a href="http://www.5bay.cn/me/kaiyuanruanjiandeyinglimoshi.html" title="开源软件的盈利模式">开源软件的盈利模式</a> (0)</li><li>2011年06月29日 -- <a href="http://www.5bay.cn/android%e7%ac%94%e8%ae%b0/wangshangzhenglideandroidquanxiandaquan.html" title="网上整理的android权限大全">网上整理的android权限大全</a> (0)</li><li>2010年07月28日 -- <a href="http://www.5bay.cn/server-building/aspeaojie.html" title="ASP防注入新方式，希望对大家是有用的">ASP防注入新方式，希望对大家是有用的</a> (0)</li><li>2010年07月28日 -- <a href="http://www.5bay.cn/server-building/eeprn-asp-jpg.html" title="如何删除删不掉的”PRN.asp:.jpg”">如何删除删不掉的”PRN.asp:.jpg”</a> (0)</li><li>2010年07月28日 -- <a href="http://www.5bay.cn/server-building/eeeeeeee-2.html" title="防止网卡被禁用的具体配置方法">防止网卡被禁用的具体配置方法</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajaxeeee.html" title="Ajax的工作原理">Ajax的工作原理</a> (1)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/eejaxeeeeee.html" title="使用Ajax时的十个常犯的错误">使用Ajax时的十个常犯的错误</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajaxeeieeeeeting.html" title="AJAX初学:IE缓存页面的问题">AJAX初学:IE缓存页面的问题</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/xmlhttpe.html" title="XMLHTTP对象封装技术">XMLHTTP对象封装技术</a> (0)</li><li>2010年05月23日 -- <a href="http://www.5bay.cn/website/nginxtongguouser-agentpanduanshoujizhongduan.html" title="nginx 通过user-agent判断手机终端">nginx 通过user-agent判断手机终端</a> (0)</li><li>2010年05月23日 -- <a href="http://www.5bay.cn/server-building/gaoxingnengwangzhanjianshezhinandushubiji.html" title="《高性能网站建设指南》读书笔记">《高性能网站建设指南》读书笔记</a> (0)</li><li>2008年01月2日 -- <a href="http://www.5bay.cn/network-programming/asp/adodbstream%E7%BB%84%E4%BB%B6%E7%9A%84%E4%BD%BF%E7%94%A8%E8%AF%B4%E6%98%8E.html" title="Adodb.Stream 组件的使用说明">Adodb.Stream 组件的使用说明</a> (0)</li></ul>
	标签Tags：<a href="http://www.5bay.cn/category/network-programming/asp" title="ASP" rel="tag">ASP</a>, <a href="http://www.5bay.cn/tag/asp" title="ASP" rel="tag">ASP</a>, <a href="http://www.5bay.cn/tag/xmlhttp" title="xmlhttp" rel="tag">xmlhttp</a>, <a href="http://www.5bay.cn/tag/%E5%9B%BE%E7%89%87%E5%9C%B0%E5%9D%80" title="图片地址" rel="tag">图片地址</a>, <a href="http://www.5bay.cn/tag/%E6%AD%A3%E5%88%99%E8%A7%A3%E6%9E%90" title="正则解析" rel="tag">正则解析</a>, <a href="http://www.5bay.cn/tag/%E7%BB%84%E4%BB%B6" title="组件" rel="tag">组件</a><br />
]]></content:encoded>
			<wfw:commentRss>http://www.5bay.cn/network-programming/asp/%E7%94%A8%E6%AD%A3%E5%88%99%E8%A7%A3%E6%9E%90%E5%9B%BE%E7%89%87%E5%9C%B0%E5%9D%80%E5%B9%B6%E5%88%A9%E7%94%A8xmlhttp%E7%BB%84%E4%BB%B6%E5%B0%86%E5%85%B6%E4%BF%9D%E5%AD%98.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>在asp文件中访问flash详细信息</title>
		<link>http://www.5bay.cn/network-programming/asp/%E5%9C%A8asp%E6%96%87%E4%BB%B6%E4%B8%AD%E8%AE%BF%E9%97%AEflash%E8%AF%A6%E7%BB%86%E4%BF%A1%E6%81%AF.html</link>
		<comments>http://www.5bay.cn/network-programming/asp/%E5%9C%A8asp%E6%96%87%E4%BB%B6%E4%B8%AD%E8%AE%BF%E9%97%AEflash%E8%AF%A6%E7%BB%86%E4%BF%A1%E6%81%AF.html#comments</comments>
		<pubDate>Sat, 29 Dec 2007 19:44:00 +0000</pubDate>
		<dc:creator>江小邪</dc:creator>
				<category><![CDATA[ASP]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[详细信息]]></category>

		<guid isPermaLink="false">?p=271</guid>
		<description><![CDATA[<a href="http://www.5bay.cn/network-programming/asp/%E5%9C%A8asp%E6%96%87%E4%BB%B6%E4%B8%AD%E8%AE%BF%E9%97%AEflash%E8%AF%A6%E7%BB%86%E4%BF%A1%E6%81%AF.html"><img align="left" hspace="5" width="150" height="150" src="http://www.5bay.cn/wp-content/plugins/thumbnail-for-excerpts/tfe_no_thumb.png" class="alignleft wp-post-image tfe" alt="" title="" /></a>= 1binary = binary &#038; inNumber mod 2inNumber = inNumber &#92; 2loopbinary = binary &#038; String(OutLenStr &#8211; len(binary), “0&#8243;)ToBin = StrReverse(binary)End Function public Function Bin2Decimal(inBin)Dim counterDim tempDim ValueinBin = StrReverse(inBin)temp = 0For counter = 1 to Len(inBin)If counter = 1 thenValue = 1ElseValue = Value * 2End Iftemp = temp + mid(inBin, counter ,1) * [...]]]></description>
			<content:encoded><![CDATA[<p><span id="more-271"></span><br/><coolcode><br /><% </p>
<p>Class SWFDump</p>
<p>dim header<br />dim RECTdata<br />dim nBits<br />dim mversion<br />dim mfilelen<br />dim mxMin<br />dim mxMax<br />dim myMin<br />dim myMax<br />dim mheigt<br />dim mwidth<br />dim mframerate<br />dim mframecount</p>
<p>public Sub Class_Initialize()</p>
<p>End Sub</p>
<p>public Sub Class_Terminate()</p>
<p>End Sub</p>
<p>public Function ReadHeader (filename)<br />Const ForReading = 1, ForWriting = 2, ForAppending = 8<br />Dim fso, f<br />Set fso = CreateObject(“Scripting.FileSystemObject”)<br />Set f = fso.OpenTextFile(filename, ForReading)<br />ReadHeader = f.Read(21)<br />End Function</p>
<p>public Function ToBin(inNumber, OutLenStr )<br />Dim binary<br />binary = “”<br />do while inNumber >= 1<br />binary = binary &#038; inNumber mod 2<br />inNumber = inNumber &#92; 2<br />loop<br />binary = binary &#038; String(OutLenStr &#8211; len(binary), “0&#8243;)<br />ToBin = StrReverse(binary)<br />End Function</p>
<p>public Function Bin2Decimal(inBin)<br />Dim counter<br />Dim temp<br />Dim Value<br />inBin = StrReverse(inBin)<br />temp = 0<br />For counter = 1 to Len(inBin)<br />If counter = 1 then<br />Value = 1<br />Else<br />Value = Value * 2<br />End If<br />temp = temp + mid(inBin, counter ,1) * Value<br />Next<br />Bin2Decimal = temp<br />End Function</p>
<p>Public Function SWFDump(fileName)</p>
<p>header = ReadHeader (fileName)<br />mversion = asc(mid(header,4,1))<br />mfilelen = asc(mid(header,5,1))<br />mfilelen = mfilelen + asc(mid(header,6,1)) * 256<br />mfilelen = mfilelen + asc(mid(header,7,1)) * 256 * 256<br />mfilelen = mfilelen + asc(mid(header,8,1)) * 256 * 256 * 256</p>
<p>RECTdata = ToBin(asc(mid(header,9,1)),8)<br />RECTdata = RECTdata &#038; ToBin(asc(mid(header,10,1)),8)<br />RECTdata = RECTdata &#038; ToBin(asc(mid(header,11,1)),8)<br />RECTdata = RECTdata &#038; ToBin(asc(mid(header,12,1)),8)<br />RECTdata = RECTdata &#038; ToBin(asc(mid(header,13,1)),8)<br />RECTdata = RECTdata &#038; ToBin(asc(mid(header,14,1)),8)<br />RECTdata = RECTdata &#038; ToBin(asc(mid(header,15,1)),8)<br />RECTdata = RECTdata &#038; ToBin(asc(mid(header,16,1)),8)<br />RECTdata = RECTdata &#038; ToBin(asc(mid(header,17,1)),8)</p>
<p>nBits = Mid(RECTdata,1,5)<br />nBits = Bin2Decimal(nBits)</p>
<p>mxMin = Bin2Decimal(Mid(RECTdata,6,nBits))<br />mxMax = Bin2Decimal(Mid(RECTdata,6 + nBits * 1 ,nBits))<br />myMin = Bin2Decimal(Mid(RECTdata,6 + nBits * 2 ,nBits))<br />myMax = Bin2Decimal(Mid(RECTdata,6 + nBits * 3 ,nBits))</p>
<p>mheigt = (myMax &#8211; myMin) / 20<br />mwidth = (mxMax &#8211; mxMin) / 20</p>
<p>mframerate = asc(mid(header,18,1))</p>
<p>mframecount = asc(mid(header,19,1))<br />mframecount = mframecount + asc(mid(header,20,1)) * 256</p>
<p>End Function</p>
<p>Public Property Get Heigt()<br />Heigt = mheigt<br />End Property</p>
<p>Public Property Get Width()<br />Width = mwidth<br />End Property</p>
<p>Public Property Get Version()<br />Version = mversion<br />End Property</p>
<p>Public Property Get FileLen()<br />FileLen = mfilelen<br />End Property</p>
<p>Public Property Get xMin()<br />xMin = mxMin<br />End Property</p>
<p>Public Property Get xMax()<br />xMax = mxMax<br />End Property</p>
<p>Public Property Get yMin()<br />yMin = myMin<br />End Property</p>
<p>Public Property Get yMax()<br />yMax = myMax<br />End Property</p>
<p>Public Property Get Framerate()<br />Framerate = mframerate<br />End Property</p>
<p>Public Property Get Framecount()<br />Framecount = mframecount<br />End Property<br />End Class<br />%></p>
<p>做成包含文件swfheaderdump.inc<br />调用：</p>
<p><!-- #include file="swfheaderdump.inc" --><br /><%<br />&#039; Pass the SWF name in querystring this way<br />&#039; swfdump.<a href="http://www.5bay.cn/tag/asp" class="st_tag internal_tag" rel="tag" title="标签 ASP 下的日志">asp</a>?swf=yourmovie.swf</p>
<p>set myObj = new swfdump<br />myObj.SWFDump (<a href="http://www.5bay.cn/tag/server" class="st_tag internal_tag" rel="tag" title="标签 server 下的日志">Server</a>.MapPath(request(“swf”)))</p>
<p>Response.Write “Heigt (pixel) = ” &#038; myObj.Heigt &#038; “<br />“<br />Response.Write “Width (pixel) = ” &#038; myObj.Width &#038; “<br />“<br />Response.Write “Version = ” &#038; myObj.Version &#038; “<br />“<br />Response.Write “FileLen (bytes) = ” &#038; myObj.FileLen &#038; “<br />“<br />Response.Write “xMin (twips) = ” &#038; myObj.xMin &#038; “<br />“<br />Response.Write “xMax (twips) = ” &#038; myObj.xMax &#038; “<br />“<br />Response.Write “yMin (twips) = ” &#038; myObj.yMin &#038; “<br />“<br />Response.Write “yMax (twips) = ” &#038; myObj.yMax &#038; “<br />“<br />Response.Write “FrameRate = ” &#038; myObj.FrameRate &#038; “<br />“<br />Response.Write “FrameCount = ” &#038; myObj.FrameCount &#038; “<br />“<br />%></p>
<p></coolcode></p>
<h2  class="related_post_title">相关博文</h2><ul class="related_post"><li>2011年06月29日 -- <a href="http://www.5bay.cn/me/kaiyuanruanjiandeyinglimoshi.html" title="开源软件的盈利模式">开源软件的盈利模式</a> (0)</li><li>2010年07月28日 -- <a href="http://www.5bay.cn/server-building/aspeaojie.html" title="ASP防注入新方式，希望对大家是有用的">ASP防注入新方式，希望对大家是有用的</a> (0)</li><li>2010年07月28日 -- <a href="http://www.5bay.cn/server-building/eeprn-asp-jpg.html" title="如何删除删不掉的”PRN.asp:.jpg”">如何删除删不掉的”PRN.asp:.jpg”</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajax.html" title="AJAX的各种控件和类库">AJAX的各种控件和类库</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/eejaxeeetpit.html" title="了解Ajax中的Get和Post ">了解Ajax中的Get和Post </a> (0)</li><li>2010年05月23日 -- <a href="http://www.5bay.cn/website/nginxtongguouser-agentpanduanshoujizhongduan.html" title="nginx 通过user-agent判断手机终端">nginx 通过user-agent判断手机终端</a> (0)</li><li>2010年05月23日 -- <a href="http://www.5bay.cn/server-building/gaoxingnengwangzhanjianshezhinandushubiji.html" title="《高性能网站建设指南》读书笔记">《高性能网站建设指南》读书笔记</a> (0)</li><li>2007年12月29日 -- <a href="http://www.5bay.cn/network-programming/asp/%E7%94%A8%E6%AD%A3%E5%88%99%E8%A7%A3%E6%9E%90%E5%9B%BE%E7%89%87%E5%9C%B0%E5%9D%80%E5%B9%B6%E5%88%A9%E7%94%A8xmlhttp%E7%BB%84%E4%BB%B6%E5%B0%86%E5%85%B6%E4%BF%9D%E5%AD%98.html" title="用正则解析图片地址,并利用XMLHTTP组件将其保存">用正则解析图片地址,并利用XMLHTTP组件将其保存</a> (0)</li><li>2007年12月29日 -- <a href="http://www.5bay.cn/network-programming/asp/asp%E5%88%9D%E5%AD%A6%E8%80%85%E5%B8%B8%E7%8A%AF%E7%9A%84%E5%87%A0%E4%B8%AA%E9%94%99%E8%AF%AF.html" title="ASP初学者常犯的几个错误">ASP初学者常犯的几个错误</a> (0)</li><li>2007年12月29日 -- <a href="http://www.5bay.cn/network-programming/asp/%E4%B8%80%E4%B8%AA%E6%96%B0%E7%9A%84jmail%E5%8F%91%E9%80%81%E4%BB%A3%E7%A0%81.html" title="一个新的JMail发送代码">一个新的JMail发送代码</a> (0)</li><li>2007年12月29日 -- <a href="http://www.5bay.cn/network-programming/asp/asp%E6%8F%90%E9%80%9F%E6%8A%80%E5%B7%A7%E4%BA%94%E5%88%99.html" title="ASP提速技巧五则">ASP提速技巧五则</a> (0)</li><li>2007年12月29日 -- <a href="http://www.5bay.cn/network-programming/asp/%E5%B7%A7%E7%94%A8asp%E7%94%9F%E6%88%90pdf%E6%96%87%E4%BB%B6.html" title="巧用ASP生成PDF文件">巧用ASP生成PDF文件</a> (1)</li><li>2007年05月8日 -- <a href="http://www.5bay.cn/network-programming/asp/asp%E7%BC%96%E7%A8%8B%E5%BF%83%E5%BE%97%E5%9B%9E%E6%94%BE.html" title="ASP编程心得回放">ASP编程心得回放</a> (0)</li><li>2007年03月21日 -- <a href="http://www.5bay.cn/network-programming/asp/asp%E8%84%9A%E6%9C%AC%E7%94%9F%E6%88%90guid%E7%9A%84%E5%AE%9E%E7%8E%B0.html" title="ASP脚本生成GUID的实现">ASP脚本生成GUID的实现</a> (0)</li><li>2007年02月9日 -- <a href="http://www.5bay.cn/network-programming/asp/asp%E5%8A%A8%E6%80%81%E5%8C%85%E5%90%AB%E6%96%87%E4%BB%B6.html" title="ASP 动态包含文件">ASP 动态包含文件</a> (0)</li></ul>
	标签Tags：<a href="http://www.5bay.cn/category/network-programming/asp" title="ASP" rel="tag">ASP</a>, <a href="http://www.5bay.cn/tag/asp" title="ASP" rel="tag">ASP</a>, <a href="http://www.5bay.cn/tag/flash" title="flash" rel="tag">flash</a>, <a href="http://www.5bay.cn/tag/%E8%AF%A6%E7%BB%86%E4%BF%A1%E6%81%AF" title="详细信息" rel="tag">详细信息</a><br />
]]></content:encoded>
			<wfw:commentRss>http://www.5bay.cn/network-programming/asp/%E5%9C%A8asp%E6%96%87%E4%BB%B6%E4%B8%AD%E8%AE%BF%E9%97%AEflash%E8%AF%A6%E7%BB%86%E4%BF%A1%E6%81%AF.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ASP初学者常犯的几个错误</title>
		<link>http://www.5bay.cn/network-programming/asp/asp%E5%88%9D%E5%AD%A6%E8%80%85%E5%B8%B8%E7%8A%AF%E7%9A%84%E5%87%A0%E4%B8%AA%E9%94%99%E8%AF%AF.html</link>
		<comments>http://www.5bay.cn/network-programming/asp/asp%E5%88%9D%E5%AD%A6%E8%80%85%E5%B8%B8%E7%8A%AF%E7%9A%84%E5%87%A0%E4%B8%AA%E9%94%99%E8%AF%AF.html#comments</comments>
		<pubDate>Sat, 29 Dec 2007 19:41:34 +0000</pubDate>
		<dc:creator>江小邪</dc:creator>
				<category><![CDATA[ASP]]></category>
		<category><![CDATA[初学者]]></category>
		<category><![CDATA[错误]]></category>

		<guid isPermaLink="false">?p=270</guid>
		<description><![CDATA[<a href="http://www.5bay.cn/network-programming/asp/asp%E5%88%9D%E5%AD%A6%E8%80%85%E5%B8%B8%E7%8A%AF%E7%9A%84%E5%87%A0%E4%B8%AA%E9%94%99%E8%AF%AF.html"><img align="left" hspace="5" width="150" height="150" src="http://www.5bay.cn/wp-content/plugins/thumbnail-for-excerpts/tfe_no_thumb.png" class="alignleft wp-post-image tfe" alt="" title="" /></a>1.记录集关闭之前再次打开:&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;sql=”select * from test”rs.open sql,conn,1,1if not rs.eof thendim myNamemyName=rs(“name”)end ifsql=”select * from myBook”rs.open sql,conn,1,1&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-解决:在第二次rs.open之前先关闭 rs.close或set rs1=server.createobjectrs1.open sql,conn,1,12,用SQL关键字做表名或字段名&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-sql=”select * from user”rs.open sql,conn,1,1&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-user为sql关键字解决:改为sql=”select * from [user]“3,用锁定方式去进行update&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-sql=”select * from [user]“rs.open sql,conn,1,1rs.addnew或rs(“userName”)=”aa”rs.update&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-当前记录集的打开方式为只读解决:改为rs.open sql,conn,1,34,在查询语句中采用的对比字段值与字段类型不符&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;sql=”select * from [user] where id= ” &#038; myID &#038; ” “rs.open sql,conn,1,1&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;假设表中设计ID为数字型，那么些时出错。解决:sql=”select * from [user] where id=” &#038; myID5,未检查变量值而出错&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;sql=”select * from [user] where id=” &#038; myIDrs.open [...]]]></description>
			<content:encoded><![CDATA[<p><span id="more-270"></span><br/>1.记录集关闭之前再次打开:<br/>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br/><a href="http://www.5bay.cn/tag/sql" class="st_tag internal_tag" rel="tag" title="标签 sql 下的日志">sql</a>=”select * from test”<br/>rs.open sql,conn,1,1<br/>if not rs.eof then<br/>dim myName<br/>myName=rs(“name”)<br/>end if<br/>sql=”select * from myBook”<br/>rs.open sql,conn,1,1<br/>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br/>解决:在第二次rs.open之前先关闭 rs.close<br/>或<br/>set rs1=<a href="http://www.5bay.cn/tag/server" class="st_tag internal_tag" rel="tag" title="标签 server 下的日志">server</a>.createobject<br/>rs1.open sql,conn,1,1<br/><br/>2,用SQL关键字做表名或字段名<br/>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br/>sql=”select * from user”<br/>rs.open sql,conn,1,1<br/>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br/>user为sql关键字<br/>解决:改为<br/>sql=”select * from [user]“<br/><br/><br/>3,用锁定方式去进行update<br/>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br/>sql=”select * from [user]“<br/>rs.open sql,conn,1,1<br/>rs.addnew<br/>或<br/>rs(“userName”)=”aa”<br/>rs.update<br/>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br/>当前记录集的打开方式为只读<br/>解决:<br/>改为<br/>rs.open sql,conn,1,3<br/><br/>4,在查询语句中采用的对比字段值与字段类型不符<br/>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br/>sql=”select * from [user] where id= ” &#038; myID &#038; ” “<br/>rs.open sql,conn,1,1<br/>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br/>假设表中设计ID为数字型，那么些时出错。<br/>解决:<br/>sql=”select * from [user] where id=” &#038; myID<br/><br/>5,未检查变量值而出错<br/>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br/>sql=”select * from [user] where id=” &#038; myID<br/>rs.open sql,conn,1,1<br/>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br/>假设myID变量此时值为null,那么sql将成为<br/>sql=”select * from [user] where id=”<br/>解决:<br/>在前面加上<br/>if isnull(myID) then 出错提示<br/><br/>6,未检查变量值类型而出错<br/>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br/>sql=”select * from [user] where id=” &#038; myID<br/>rs.open sql,conn,1,1<br/>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br/>假设id为数字型,myID变量此时值不为null,但为字符，比如myID此时为”aa”<br/>那么sql将成为<br/>sql=”select * from [user] where id=aa”<br/>解决:<br/>在前面加上<br/>if isnumeric(myID)=false then 出错提示<br/><br/>这也可以有效防止 sql injection 漏洞攻击。<br/><br/>7,由于数据库文件所在目录的NTFS权限而引起的 不能更新。数据库或对象为只读”<a href="http://www.5bay.cn/tag/%E9%94%99%E8%AF%AF" class="st_tag internal_tag" rel="tag" title="标签 错误 下的日志">错误</a>。<br/>说明:<br/>WIN2K系统延续了WINNT系统的NTFS权限。<br/>对于系统中的文夹都有默认的安全设置。<br/>而通过HTTP对WWW访问时的系统默认用户是 iusr_计算机名 用户 ,它属于guest组。<br/>当通过HTTP访问时，可以ASP或JSP，也或是PHP或.NET程序对数据进行修改操作：<br/>比如：<br/>当打开某一个文章时，程序设定，文章的阅读次数=原阅读次数+1<br/>执行<br/>conn.execute(“update arts set clicks=clicks+1 where id=n”)<br/>语句时，如果 iusr_计算机名 用户没有对数据库的写权限时，就会出错.<br/><a href="http://www.5bay.cn/tag/%E8%A7%A3%E5%86%B3%E6%96%B9%E6%B3%95" class="st_tag internal_tag" rel="tag" title="标签 解决方法 下的日志">解决方法</a>:<br/>找到数据库所在目录<br/>右键》<a href="http://www.5bay.cn/tag/%E5%B1%9E%E6%80%A7" class="st_tag internal_tag" rel="tag" title="标签 属性 下的日志">属性</a>》安全选项卡》设置 iusr_计算机名 用户的写权限(当然，也可以是everyone)<br/></p>
<h2  class="related_post_title">相关博文</h2><ul class="related_post"><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/eeeeeeee.html" title="最令PHP初学者头痛的十四个问题">最令PHP初学者头痛的十四个问题</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajax.html" title="AJAX的各种控件和类库">AJAX的各种控件和类库</a> (0)</li><li>2011年06月29日 -- <a href="http://www.5bay.cn/me/kaiyuanruanjiandeyinglimoshi.html" title="开源软件的盈利模式">开源软件的盈利模式</a> (0)</li><li>2010年07月28日 -- <a href="http://www.5bay.cn/server-building/aspeaojie.html" title="ASP防注入新方式，希望对大家是有用的">ASP防注入新方式，希望对大家是有用的</a> (0)</li><li>2010年07月28日 -- <a href="http://www.5bay.cn/server-building/eeprn-asp-jpg.html" title="如何删除删不掉的”PRN.asp:.jpg”">如何删除删不掉的”PRN.asp:.jpg”</a> (0)</li><li>2010年07月28日 -- <a href="http://www.5bay.cn/server-building/ep.html" title="让IIS只监听指定IP">让IIS只监听指定IP</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/phpeecketee.html" title="PHP和Socket简介">PHP和Socket简介</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/peeeeee.html" title="深入探讨PHP中的内存管理问题">深入探讨PHP中的内存管理问题</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/requireeecludexi.html" title="require和include的异同">require和include的异同</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajaxeeaoe.html" title="AJAX应用程序开发七宗罪">AJAX应用程序开发七宗罪</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/eejaxeeeeee.html" title="使用Ajax时的十个常犯的错误">使用Ajax时的十个常犯的错误</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/eejaxeeetpit.html" title="了解Ajax中的Get和Post ">了解Ajax中的Get和Post </a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/xmlhttpe.html" title="XMLHTTP对象封装技术">XMLHTTP对象封装技术</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajaxxuan.html" title="ajax的缺点">ajax的缺点</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/phpeezhanchang.html" title="PHP安全之数据过滤">PHP安全之数据过滤</a> (0)</li></ul>
	标签Tags：<a href="http://www.5bay.cn/category/network-programming/asp" title="ASP" rel="tag">ASP</a>, <a href="http://www.5bay.cn/tag/asp" title="ASP" rel="tag">ASP</a>, <a href="http://www.5bay.cn/tag/%E5%88%9D%E5%AD%A6%E8%80%85" title="初学者" rel="tag">初学者</a>, <a href="http://www.5bay.cn/tag/%E9%94%99%E8%AF%AF" title="错误" rel="tag">错误</a><br />
]]></content:encoded>
			<wfw:commentRss>http://www.5bay.cn/network-programming/asp/asp%E5%88%9D%E5%AD%A6%E8%80%85%E5%B8%B8%E7%8A%AF%E7%9A%84%E5%87%A0%E4%B8%AA%E9%94%99%E8%AF%AF.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>一个新的JMail发送代码</title>
		<link>http://www.5bay.cn/network-programming/asp/%E4%B8%80%E4%B8%AA%E6%96%B0%E7%9A%84jmail%E5%8F%91%E9%80%81%E4%BB%A3%E7%A0%81.html</link>
		<comments>http://www.5bay.cn/network-programming/asp/%E4%B8%80%E4%B8%AA%E6%96%B0%E7%9A%84jmail%E5%8F%91%E9%80%81%E4%BB%A3%E7%A0%81.html#comments</comments>
		<pubDate>Sat, 29 Dec 2007 19:36:40 +0000</pubDate>
		<dc:creator>江小邪</dc:creator>
				<category><![CDATA[ASP]]></category>
		<category><![CDATA[jmail]]></category>
		<category><![CDATA[代码]]></category>

		<guid isPermaLink="false">?p=269</guid>
		<description><![CDATA[<a href="http://www.5bay.cn/network-programming/asp/%E4%B8%80%E4%B8%AA%E6%96%B0%E7%9A%84jmail%E5%8F%91%E9%80%81%E4%BB%A3%E7%A0%81.html"><img align="left" hspace="5" width="150" height="150" src="http://www.5bay.cn/wp-content/plugins/thumbnail-for-excerpts/tfe_no_thumb.png" class="alignleft wp-post-image tfe" alt="" title="" /></a>该段代码涉及到JMail v4.3的大部分常用方法。 包括邮件基本信息、身份验证、附件等。无需很多的修改就可以使用，也可以改成函数或过程。 相关博文2011年06月29日 -- 开源软件的盈利模式 (0)2010年07月28日 -- ASP防注入新方式，希望对大家是有用的 (0)2010年07月28日 -- 如何删除删不掉的”PRN.asp:.jpg” (0)2010年07月26日 -- AJAX的各种控件和类库 (0)2006年12月22日 -- 使用模板实现ASP代码与页面分离 (0)2011年06月29日 -- 在Android中创建启动界面 (0)2011年06月29日 -- 资深设计师Tony Ventrice解析手机游戏开发的四个层次 (0)2010年07月28日 -- 无需输入密码登陆3389 (0)2010年07月28日 -- Webshell下破解计算机管理员密码 (0)2010年07月28日 -- 让IIS只监听指定IP (0)2010年07月26日 -- PHP和Socket简介 (0)2010年07月26日 -- php的文档句法(heredoc)]]></description>
			<content:encoded><![CDATA[<p>该段代码涉及到JMail v4.3的大部分常用方法。 <br/>包括邮件基本信息、身份验证、附件等。无需很多的修改就可以使用，也可以改成函数或过程。 <span id="more-269"></span><br/><coolcode> <br /><% <br />Dim <a href="http://www.5bay.cn/tag/jmail" class="st_tag internal_tag" rel="tag" title="标签 jmail 下的日志">JMail</a>, contentId <br />Set JMail = <a href="http://www.5bay.cn/tag/server" class="st_tag internal_tag" rel="tag" title="标签 server 下的日志">Server</a>.CreateObject(“JMail.Message”) </p>
<p>JMail.Charset = “gb2312&#8243; &#039; 邮件字符集，默认为”US-ASCII” <br />&#039; JMail.ISOEncodeHeaders = False &#039; 是否进行ISO编码，默认为True </p>
<p>&#039; 发送者信息（可用变量方式赋值） <br />JMail.From = “test@5bay.cn” &#039; 发送者地址 <br />JMail.FromName = “D.J.” &#039; 发送者姓名 <br />JMail.Subject = “您在无风的港湾的资讯快递（请将编码设为简体中文(gb2312)）” &#039; 邮件主题 </p>
<p>&#039; 身份验证 <br />JMail.MailServerUserName = “user” &#039; 身份验证的用户名 <br />JMail.MailServerPassword = “password” &#039; 身份验证的密码 </p>
<p>&#039; 设置优先级，范围从1到5，越大的优先级越高，3为普通 <br />JMail.Priority = 3 </p>
<p>JMail.AddHeader “Originating-IP”, Request.ServerVariables(“REMOTE_ADDR”) </p>
<p>&#039; 加入一个收件人【变量email：收件人地址】可以同一语句重复加入多个 <br />JMail.AddRecipient(email) </p>
<p>&#039; 加入附件【变量filename：附件文件的绝对地址，确保用户IUSR_????有访问的权限】 <br />&#039; 【参数设置是(True)否(False)为Inline方式】 <br />contentId = JMail.AddAttachment (filename, True) </p>
<p>&#039; 邮件主体（<a href="http://www.5bay.cn/tag/html" class="st_tag internal_tag" rel="tag" title="标签 html 下的日志">HTML</a>(注意信件内链接附件的方式)） <br />JMail.HTMLBody = “<html><head><META content=zh-cn http-equiv=Content-Language><meta http-equiv=""Content-Type"" content=""text/html; charset=gb2312""><br />
<style type=text/css>A:link { FONT-SIZE: 9pt; TEXT-DECORATION: none; color: #000000}A:visited {FONT-SIZE: 9pt; TEXT-DECORATION: none; color: #666666}A:hover {COLOR: #ff6600; FONT-SIZE: 9pt; TEXT-DECORATION: underline}BODY {FONT-SIZE: 9pt} --></style>
<p></head><body   bgcolor=""#FFFFFF"" text=""#666666"" leftmargin=""0"" topmargin=""30"" link=""#FF9900""><center>点击这里<a href=&#039; cid:" &amp;amp; contentId &amp;amp; "&#039; >&#91;附件文件&#93;</a>将文件保存</center></body></html>” </p>
<p>&#039; 邮件主体（文本部分） <br />JMail.Body = “我们的邮件采用了HTML格式，但是您的邮件查看软件可能不支持。您可以访问以下地址来查看：http://music.liuxuan.com” </p>
<p>&#039; 发送【调用格式：objJMail.Send(&#91;username:password@&#93;SMTPServerAddress&#91;:Port&#93;)】 <br />JMail.Send(“user:password@smtp.5bay.cn”) </p>
<p>&#039; 关闭并清除对象 <br />JMail.Close() <br />Set JMail = Nothing <br />%><br /></coolcode><br/></p>
<h2  class="related_post_title">相关博文</h2><ul class="related_post"><li>2011年06月29日 -- <a href="http://www.5bay.cn/me/kaiyuanruanjiandeyinglimoshi.html" title="开源软件的盈利模式">开源软件的盈利模式</a> (0)</li><li>2010年07月28日 -- <a href="http://www.5bay.cn/server-building/aspeaojie.html" title="ASP防注入新方式，希望对大家是有用的">ASP防注入新方式，希望对大家是有用的</a> (0)</li><li>2010年07月28日 -- <a href="http://www.5bay.cn/server-building/eeprn-asp-jpg.html" title="如何删除删不掉的”PRN.asp:.jpg”">如何删除删不掉的”PRN.asp:.jpg”</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajax.html" title="AJAX的各种控件和类库">AJAX的各种控件和类库</a> (0)</li><li>2006年12月22日 -- <a href="http://www.5bay.cn/network-programming/asp/%E4%BD%BF%E7%94%A8%E6%A8%A1%E6%9D%BF%E5%AE%9E%E7%8E%B0asp%E4%BB%A3%E7%A0%81%E4%B8%8E%E9%A1%B5%E9%9D%A2%E5%88%86%E7%A6%BB.html" title="使用模板实现ASP代码与页面分离">使用模板实现ASP代码与页面分离</a> (0)</li><li>2011年06月29日 -- <a href="http://www.5bay.cn/android%e7%ac%94%e8%ae%b0/zaiandroidzhongchuangjianqidongjiemian.html" title="在Android中创建启动界面">在Android中创建启动界面</a> (0)</li><li>2011年06月29日 -- <a href="http://www.5bay.cn/game-development/zishenshejishitonyventricejiexishoujiyouxikaifadesigecengci.html" title="资深设计师Tony Ventrice解析手机游戏开发的四个层次">资深设计师Tony Ventrice解析手机游戏开发的四个层次</a> (0)</li><li>2010年07月28日 -- <a href="http://www.5bay.cn/server-building/eeeeee389.html" title="无需输入密码登陆3389">无需输入密码登陆3389</a> (0)</li><li>2010年07月28日 -- <a href="http://www.5bay.cn/server-building/webshelleechueeee.html" title="Webshell下破解计算机管理员密码">Webshell下破解计算机管理员密码</a> (0)</li><li>2010年07月28日 -- <a href="http://www.5bay.cn/server-building/ep.html" title="让IIS只监听指定IP">让IIS只监听指定IP</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/phpeecketee.html" title="PHP和Socket简介">PHP和Socket简介</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/phpeefangeredoc.html" title="php的文档句法(heredoc)<<<和PHP字符串操作">php的文档句法(heredoc)<<<和PHP字符串操作</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/peeeeee.html" title="深入探讨PHP中的内存管理问题">深入探讨PHP中的内存管理问题</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/requireeecludexi.html" title="require和include的异同">require和include的异同</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajaxeeee.html" title="Ajax的工作原理">Ajax的工作原理</a> (1)</li></ul>
	标签Tags：<a href="http://www.5bay.cn/category/network-programming/asp" title="ASP" rel="tag">ASP</a>, <a href="http://www.5bay.cn/tag/asp" title="ASP" rel="tag">ASP</a>, <a href="http://www.5bay.cn/tag/jmail" title="jmail" rel="tag">jmail</a>, <a href="http://www.5bay.cn/tag/%E4%BB%A3%E7%A0%81" title="代码" rel="tag">代码</a><br />
]]></content:encoded>
			<wfw:commentRss>http://www.5bay.cn/network-programming/asp/%E4%B8%80%E4%B8%AA%E6%96%B0%E7%9A%84jmail%E5%8F%91%E9%80%81%E4%BB%A3%E7%A0%81.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ASP提速技巧五则</title>
		<link>http://www.5bay.cn/network-programming/asp/asp%E6%8F%90%E9%80%9F%E6%8A%80%E5%B7%A7%E4%BA%94%E5%88%99.html</link>
		<comments>http://www.5bay.cn/network-programming/asp/asp%E6%8F%90%E9%80%9F%E6%8A%80%E5%B7%A7%E4%BA%94%E5%88%99.html#comments</comments>
		<pubDate>Sat, 29 Dec 2007 19:33:51 +0000</pubDate>
		<dc:creator>江小邪</dc:creator>
				<category><![CDATA[ASP]]></category>
		<category><![CDATA[技巧]]></category>
		<category><![CDATA[提速]]></category>

		<guid isPermaLink="false">?p=268</guid>
		<description><![CDATA[<a href="http://www.5bay.cn/network-programming/asp/asp%E6%8F%90%E9%80%9F%E6%8A%80%E5%B7%A7%E4%BA%94%E5%88%99.html"><img align="left" hspace="5" width="150" height="150" src="http://www.5bay.cn/wp-content/plugins/thumbnail-for-excerpts/tfe_no_thumb.png" class="alignleft wp-post-image tfe" alt="" title="" /></a>今天我给大家讲一下如何提高ASP提速技巧的五则方法希望能对大家有所帮助！技巧之一：提高使用Request集合的效率 　　访问一个ASP集合来提取一个值是费时的、占用计算资源的过程。因为这个操作包含了一系列对相关集合的搜索，这比访问一个局部变量要慢得多。因此，如果打算在页面中多次使用Request集合中的一个值，应该考虑将其存贮为一个局部变量。例如将代码写成下面的形式以加快脚本引擎处理速度： strTitle=Request.Form(“Title”) strFirstName=Request.Form(“FirstName”)　 strLastName=Request.Form(“LastName”)　 If Len(strTitle) Then strTitle=strTitle &#038; ” “　 If strFirstName=”" Then strFullName=strTitle &#038; ” ” &#038; strLastName　 Elseif Len(strFirstName)=1 Then strFullName=strTitle &#038; strFirstName &#038; “. ” &#038; strLastName Else strFullName=strTitle &#038; strFirstName &#038; ” ” &#038; strLastName　 End If 技巧之二：直接访问适当的集合 　　如果不是别无选择，否则不要使用strPage=Request(“page”)的这样的形式来获取参数，因为这将按顺序搜索全部的集合—QueryString、Form、Cookies、ClientCertificate、ServerVarible直到发现第一个匹配值的名称。这样做比直接访问适当的集合效率低，并且是不安全的，除非能绝对保证这个值不会出现在另外一个集合中。 例如，可能希望搜索满足客户请求的WEB服务器名称，这通过出现在每个查询中的Request.ServerVarables集合中寻找“SERVER_NAME”来实现。然而，假如其他的集合也包含名为“SERVER_NAME”的值（键名不区分大小写），当使用Request(“server_Name”)时，就会得到错误的结果。总而言之，应尽可能直接访问适当的集合。 技巧之三：在费时操作前使用Response.IsClientConnected属性 　　使用Response.IsClientConnected是观察用户是否仍连到服务器并正在载入ASP创建的网页的有用方式。如果用户断开连接或停止下载，我们就不用再浪费服务器的资源创建网页，因为缓冲区内容将被IIS丢弃。所以，对那些需要大量时间计算或资源使用较多的网页来说，值得在每一阶段都检查游览者是否已离线： …… Code to create first part of [...]]]></description>
			<content:encoded><![CDATA[<p>今天我给大家讲一下如何提高ASP提速技巧的五则方法希望能对大家有所帮助！<br/><br/>技巧之一：提高使用Request集合的效率 <br/>　　访问一个ASP集合来提取一个值是费时的、占用计算资源的过程。因为这个操作包含了一系列对相关集合的搜索，这比访问一个局部变量要慢得多。因此，如果打算在页面中多次使用Request集合中的一个值，应该考虑将其存贮为一个局部变量。例如将代码写成下面的形式以加快脚本引擎处理速度： <br/><br/>strTitle=Request.Form(“Title”) <br/>strFirstName=Request.Form(“FirstName”)　 <br/>strLastName=Request.Form(“LastName”)　 <br/>If Len(strTitle) Then strTitle=strTitle &#038; ” “　 <br/>If strFirstName=”" Then strFullName=strTitle &#038; ” ” &#038; strLastName　 <br/>Elseif Len(strFirstName)=1 Then <br/>strFullName=strTitle &#038; strFirstName &#038; “. ” &#038; strLastName <br/>Else <br/>strFullName=strTitle &#038; strFirstName &#038; ” ” &#038; strLastName　 <br/>End If <br/><span id="more-268"></span><br/><br/>技巧之二：直接访问适当的集合 <br/><br/>　　如果不是别无选择，否则不要使用strPage=Request(“page”)的这样的形式来获取参数，因为这将按顺序搜索全部的集合—QueryString、Form、Cookies、ClientCertificate、ServerVarible直到发现第一个匹配值的名称。这样做比直接访问适当的集合效率低，并且是不安全的，除非能绝对保证这个值不会出现在另外一个集合中。 <br/>例如，可能希望搜索满足客户请求的WEB服务器名称，这通过出现在每个查询中的Request.ServerVarables集合中寻找“SERVER_NAME”来实现。然而，假如其他的集合也包含名为“SERVER_NAME”的值（键名不区分大小写），当使用Request(“server_Name”)时，就会得到错误的结果。总而言之，应尽可能直接访问适当的集合。 <br/><br/><br/>技巧之三：在费时操作前使用Response.IsClientConnected属性 <br/><br/>　　使用Response.IsClientConnected是观察用户是否仍连到服务器并正在载入ASP创建的网页的有用方式。如果用户断开连接或停止下载，我们就不用再浪费服务器的资源创建网页，因为缓冲区内容将被IIS丢弃。所以，对那些需要大量时间计算或资源使用较多的网页来说，值得在每一阶段都检查游览者是否已离线： <br/><br/>…… <a href="http://www.5bay.cn/tag/code" class="st_tag internal_tag" rel="tag" title="标签 code 下的日志">Code</a> to create first part of the page <br/>If Response.IsClientConnected Then <br/>Response.Flush <br/>Else <br/>Response.End <br/>End If <br/>…… Code to create next part of page <br/><br/><br/>技巧之四：优化ASP中的ADO操作 <br/><br/>通常面言，数据构成了WEB站点的实际内容。所以，优化ADO操作以加速ASP代码执行，十分有用： <br/>a. 仅选择所需的列：当打开ADO记录集时，除非需要获得所有的列，否则不应自动地使用表名（即SELECT*）。使用单独的列意味着将减少发送到服务器或从服务器取出的数据量。即使需要使用全部列，单独地命名每个列也会获得最佳的性能，因为服务器不必再解释这些列的名字。 <br/><br/>b. 尽可能的使用存储过程。存储过程是预先编译的程序，含有一个已经准备好的执行计划，所以比SQL语句执行更快。 <br/><br/>c. 使用适当的光标和锁定模式。如果所做的全部工作只是从记录集中读取数据，并将其显示在屏幕上，那么就使用缺省的只能前移、只读的记录集。ADO用来维护记录和锁定的细节的工作越少，执行的性能就越高。 <br/><br/>d. 使用对象变量。当遍历记录集时一个肯定能提高性能的方法是使用对象变量指向集合中的成员。例如： <br/><br/>While Not RsGc.EOF <br/>Response.Write “工程名称：” &#038; RsGc(“GcMC”) &#038; “(工程代码：” &#038; RsGc(“GcCode”) &#038; “) “　 <br/>RsGc.MoveNext <br/>Wend <br/><br/>可以用改写为下面的代码以加快执行： <br/><br/>set GcMc=RsGc(“GcMc”) <br/>set GcCode=RsGc(“GcCode”)　 <br/>While Not rsGc.EOF Response.Write “工程名称：” &#038; GcMc &#038; “(工程代码：” &#038; GcCode &#038; “) <br/>” RsGc.MoveNext　 <br/>Wend <br/><br/>　　新的代码建立了对象变量的引用，所以可以使用对象变量而不是实际的变量，这意味着脚本引擎的工作减少了，因为在集合中进行索引的次数变少了。 <br/><br/><br/>技巧五：不要混用脚本引擎 <br/><br/>　　我们知道，ASP页面中既可以使用VBScript，也可以使用JScript。但是在同一个页面上同时使用JScript和VBScript则是不可取的。因为服务器必须实例化并尝试缓存两个（而不是一个）脚本引擎，这在一定程度上增加了系统负担。因此，从性能上考虑，不应在同一页面中混用多种脚本引擎!<br/></p>
<h2  class="related_post_title">相关博文</h2><ul class="related_post"><li>2011年06月29日 -- <a href="http://www.5bay.cn/me/kaiyuanruanjiandeyinglimoshi.html" title="开源软件的盈利模式">开源软件的盈利模式</a> (0)</li><li>2011年06月29日 -- <a href="http://www.5bay.cn/game-development/zishenshejishitonyventricejiexishoujiyouxikaifadesigecengci.html" title="资深设计师Tony Ventrice解析手机游戏开发的四个层次">资深设计师Tony Ventrice解析手机游戏开发的四个层次</a> (0)</li><li>2010年07月28日 -- <a href="http://www.5bay.cn/server-building/aspeaojie.html" title="ASP防注入新方式，希望对大家是有用的">ASP防注入新方式，希望对大家是有用的</a> (0)</li><li>2010年07月28日 -- <a href="http://www.5bay.cn/server-building/eeprn-asp-jpg.html" title="如何删除删不掉的”PRN.asp:.jpg”">如何删除删不掉的”PRN.asp:.jpg”</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajax.html" title="AJAX的各种控件和类库">AJAX的各种控件和类库</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/eejaxeeetpit.html" title="了解Ajax中的Get和Post ">了解Ajax中的Get和Post </a> (0)</li><li>2010年05月23日 -- <a href="http://www.5bay.cn/server-building/eacceleratoryumemcachedequbieyuyongtu.html" title="eAccelerator与memcache的区别与用途">eAccelerator与memcache的区别与用途</a> (2)</li><li>2010年05月23日 -- <a href="http://www.5bay.cn/website/nginxtongguouser-agentpanduanshoujizhongduan.html" title="nginx 通过user-agent判断手机终端">nginx 通过user-agent判断手机终端</a> (0)</li><li>2007年12月29日 -- <a href="http://www.5bay.cn/network-programming/asp/%E7%94%A8%E6%AD%A3%E5%88%99%E8%A7%A3%E6%9E%90%E5%9B%BE%E7%89%87%E5%9C%B0%E5%9D%80%E5%B9%B6%E5%88%A9%E7%94%A8xmlhttp%E7%BB%84%E4%BB%B6%E5%B0%86%E5%85%B6%E4%BF%9D%E5%AD%98.html" title="用正则解析图片地址,并利用XMLHTTP组件将其保存">用正则解析图片地址,并利用XMLHTTP组件将其保存</a> (0)</li><li>2007年12月29日 -- <a href="http://www.5bay.cn/network-programming/asp/%E5%9C%A8asp%E6%96%87%E4%BB%B6%E4%B8%AD%E8%AE%BF%E9%97%AEflash%E8%AF%A6%E7%BB%86%E4%BF%A1%E6%81%AF.html" title="在asp文件中访问flash详细信息">在asp文件中访问flash详细信息</a> (0)</li><li>2007年12月29日 -- <a href="http://www.5bay.cn/network-programming/asp/asp%E5%88%9D%E5%AD%A6%E8%80%85%E5%B8%B8%E7%8A%AF%E7%9A%84%E5%87%A0%E4%B8%AA%E9%94%99%E8%AF%AF.html" title="ASP初学者常犯的几个错误">ASP初学者常犯的几个错误</a> (0)</li><li>2007年12月29日 -- <a href="http://www.5bay.cn/network-programming/asp/%E4%B8%80%E4%B8%AA%E6%96%B0%E7%9A%84jmail%E5%8F%91%E9%80%81%E4%BB%A3%E7%A0%81.html" title="一个新的JMail发送代码">一个新的JMail发送代码</a> (0)</li><li>2007年12月29日 -- <a href="http://www.5bay.cn/network-programming/asp/%E5%B7%A7%E7%94%A8asp%E7%94%9F%E6%88%90pdf%E6%96%87%E4%BB%B6.html" title="巧用ASP生成PDF文件">巧用ASP生成PDF文件</a> (1)</li><li>2007年05月8日 -- <a href="http://www.5bay.cn/network-programming/php/php%E6%8A%80%E5%B7%A7%E5%85%A8%E9%9B%86.html" title="PHP技巧全集">PHP技巧全集</a> (0)</li><li>2007年05月8日 -- <a href="http://www.5bay.cn/network-programming/asp/asp%E7%BC%96%E7%A8%8B%E5%BF%83%E5%BE%97%E5%9B%9E%E6%94%BE.html" title="ASP编程心得回放">ASP编程心得回放</a> (0)</li></ul>
	标签Tags：<a href="http://www.5bay.cn/category/network-programming/asp" title="ASP" rel="tag">ASP</a>, <a href="http://www.5bay.cn/tag/asp" title="ASP" rel="tag">ASP</a>, <a href="http://www.5bay.cn/tag/%E6%8A%80%E5%B7%A7" title="技巧" rel="tag">技巧</a>, <a href="http://www.5bay.cn/tag/%E6%8F%90%E9%80%9F" title="提速" rel="tag">提速</a><br />
]]></content:encoded>
			<wfw:commentRss>http://www.5bay.cn/network-programming/asp/asp%E6%8F%90%E9%80%9F%E6%8A%80%E5%B7%A7%E4%BA%94%E5%88%99.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>巧用ASP生成PDF文件</title>
		<link>http://www.5bay.cn/network-programming/asp/%E5%B7%A7%E7%94%A8asp%E7%94%9F%E6%88%90pdf%E6%96%87%E4%BB%B6.html</link>
		<comments>http://www.5bay.cn/network-programming/asp/%E5%B7%A7%E7%94%A8asp%E7%94%9F%E6%88%90pdf%E6%96%87%E4%BB%B6.html#comments</comments>
		<pubDate>Sat, 29 Dec 2007 19:31:51 +0000</pubDate>
		<dc:creator>江小邪</dc:creator>
				<category><![CDATA[ASP]]></category>
		<category><![CDATA[pdf]]></category>

		<guid isPermaLink="false">?p=267</guid>
		<description><![CDATA[<a href="http://www.5bay.cn/network-programming/asp/%E5%B7%A7%E7%94%A8asp%E7%94%9F%E6%88%90pdf%E6%96%87%E4%BB%B6.html"><img align="left" hspace="5" width="150" height="150" src="http://www.5bay.cn/wp-content/plugins/thumbnail-for-excerpts/tfe_no_thumb.png" class="alignleft wp-post-image tfe" alt="" title="" /></a>Adobe PDF格式已经变成很多机构和公司进行跨平台制表的通用媒体格式。尽管我不是这个产品的狂热痴迷者，却不得不接受这样一个事实：用这个格式产生一个协定可能会比用Word还要好。由于在一家雇用公司工作，我已经把我们所有早期的软件写成能在Internet上运行，这样我们就能和小的子公司共享公用数据库了。然而我们遇到的最大的问题就是制表。当一个申请人坐在信息站里在线填写他们的就业申请时，我们如何取得当前的文档（或申请等）？由于我们做了大量工作来获取数据，我们还需要申请人手工填写一份申请。我试了各种办法，但是看来都有一个很大的限制：如果我能快速产生它，它就只能是一个HTML形式的衍生物，在打印时就会变得面目全非。如果设计的看起来美观一些，它就会变得很慢。这是由于我选择用RTF格式作为我的首选项，然后使用文件系统对象来完成基于模板的RTF文件，最后加入了我的信息。这个磁盘读写的过程会耗费很长时间。记住：我们这里不是在讨论列表数据或者一个Excel电子表格。我们是想让程序用我们自己的标志进行处理。最后，我选择了Adobe（很像一句广告词？——译者）。我讨厌它的浏览器所以希望自己不会和它纠缠上，然而它的格式看起来很不错而且文件也不大。大部分用户都在系统里装上它，我们的客户也不例外。因此我一直在寻找把数据从HTML表单传递到PDF文件的方法。我试过使用Adobe表单，但是它不能真正有效运行，然后还要统计如何合并数据库请求。这根本不是我想要的东西，我想直接把数据从我的HTML表单传递到数据库，然后产生数据信息到PDF文件里作为浏览或打印。最终我在UseNet发现了线索。一个叫Jeremy Hunter的提交的一个链接包含了我准备在这里讲的很多东西——http://partners.adobe.com/asn/developer/acrosdk/forms.html。首先必须在定义字段的工作站（不是服务器）上安装有Adobe完全版。这个是一个指向Adobe Forms Acrobat Toolkit的链接，由此开始一切就容易了。第一、下载这个套装工具并把它解压缩到指定目录。当你进行这一步操作时，你会发现所有源代码都在VB或VC++中。我们这里不打算关注它，但是如果你需要代码就在这里。第二、注册你的DLL。有两个DLL需要被复制到你的服务器上。一个在Visual Basic文件夹中叫fdfacx.dll，另一个在Visual C++文件夹中叫fdftk.dll。用regsvr32注册fdfacx.dll文件。我把这两个文件都放到c:winntsystem32下，并在当前路径下输入“regsvr32 fdftk.dll”。如果你遇到错误提示信息，请检查确认这两个文件确实在当前目录下，没有问题则进入下一步。第三、建立表单。我们将使用每个人对这个示范都很熟悉的表单。这在“http://www.irs.gov”随意可得并为我们提供足够的领域来展示我们能作的东西。第四、定义Adobe表单字段。在Adobe Acrobat中打开文档后选择表单工具，描述你的第一个表单字段（First Name）。在你定义后它将让你命名，我这里命名为“FirstName”。注意这里有几个标准的附加格式选项，除了字体大小，我选择进行合法性检查和格式化我的ASP文档。由于这是一个快速演示，我选择跳过任何检查，但是我将在客户端的表单进行处理，并在传递变量前在服务端格式化ASP页面。继续其他字段，每一个都要注意命名并可能格式化字体大小或属性。在服务器上保存你的修改。第五、编写ASP页面。在开始这一步之前你要注意到FDF套装工具阐述的一个主要对象——“FDFApp.FDFApp”。它开放了许多方法，手册上概述了其他的可能方法。我们主要关心两个方法——fdfSetValue和fdfSetFile。接下来切入正题。第六、没有必要成为PDF专家，这是我目前的建议。套装工具的用户指导概述了所有方法，看上去在这个入门介绍之外还有很多可能的方法。就像你所看到的一样，你可以很容易添加数据库命令来收集数据或向数据库记录数据。 相关博文2011年06月29日 -- 开源软件的盈利模式 (0)2010年07月28日 -- ASP防注入新方式，希望对大家是有用的 (0)2010年07月28日 -- 如何删除删不掉的”PRN.asp:.jpg” (0)2010年07月26日 -- AJAX的各种控件和类库 (0)2010年07月26日 -- 了解Ajax中的Get和Post (0)2010年05月23日 -- nginx 通过user-agent判断手机终端 (0)2007年12月29日 -- 用正则解析图片地址,并利用XMLHTTP组件将其保存 (0)2007年12月29日 -- 在asp文件中访问flash详细信息 (0)2007年12月29日 -- ASP初学者常犯的几个错误 (0)2007年12月29日 -- 一个新的JMail发送代码 (0)2007年12月29日 -- ASP提速技巧五则 (0)2007年05月8日 -- ASP编程心得回放 (0)2007年03月21日 -- ASP脚本生成GUID的实现 (0)2007年02月9日 -- ASP 动态包含文件 [...]]]></description>
			<content:encoded><![CDATA[<p>Adobe PDF格式已经变成很多机构和公司进行跨平台制表的通用媒体格式。尽管我不是这个产品的狂热痴迷者，却不得不接受这样一个事实：用这个格式产生一个协定可能会比用Word还要好。<br/><br/>由于在一家雇用公司工作，我已经把我们所有早期的软件写成能在Internet上运行，这样我们就能和小的子公司共享公用数据库了。然而我们遇到的最大的问题就是制表。当一个申请人坐在信息站里在线填写他们的就业申请时，我们如何取得当前的文档（或申请等）？由于我们做了大量工作来获取数据，我们还需要申请人手工填写一份申请。<span id="more-267"></span><br/><br/>我试了各种办法，但是看来都有一个很大的限制：<br/><br/>如果我能快速产生它，它就只能是一个HTML形式的衍生物，在打印时就会变得面目全非。如果设计的看起来美观一些，它就会变得很慢。这是由于我选择用RTF格式作为我的首选项，然后使用文件系统对象来完成基于模板的RTF文件，最后加入了我的信息。这个磁盘读写的过程会耗费很长时间。记住：我们这里不是在讨论列表数据或者一个Excel电子表格。我们是想让程序用我们自己的标志进行处理。<br/><br/>最后，我选择了Adobe（很像一句广告词？——译者）。我讨厌它的浏览器所以希望自己不会和它纠缠上，然而它的格式看起来很不错而且文件也不大。大部分用户都在系统里装上它，我们的客户也不例外。<br/><br/>因此我一直在寻找把数据从HTML表单传递到PDF文件的方法。我试过使用Adobe表单，但是它不能真正有效运行，然后还要统计如何合并数据库请求。这根本不是我想要的东西，我想直接把数据从我的HTML表单传递到数据库，然后产生数据信息到PDF文件里作为浏览或打印。<br/>最终我在UseNet发现了线索。一个叫Jeremy Hunter的提交的一个链接包含了我准备在这里讲的很多东西——http://partners.adobe.com/asn/developer/acrosdk/forms.<a href="http://www.5bay.cn/tag/html" class="st_tag internal_tag" rel="tag" title="标签 html 下的日志">html</a>。<br/><br/>首先必须在定义字段的工作站（不是服务器）上安装有Adobe完全版。这个是一个指向Adobe Forms Acrobat Toolkit的链接，由此开始一切就容易了。<br/><br/><br/>第一、下载这个套装工具并把它解压缩到指定目录。<br/><br/>当你进行这一步操作时，你会发现所有源代码都在VB或VC++中。我们这里不打算关注它，但是如果你需要代码就在这里。<br/><br/><br/>第二、注册你的DLL。<br/><br/>有两个DLL需要被复制到你的服务器上。一个在Visual Basic文件夹中叫fdfacx.dll，另一个在Visual C++文件夹中叫fdftk.dll。用regsvr32注册fdfacx.dll文件。我把这两个文件都放到c:winntsystem32下，并在当前路径下输入“regsvr32 fdftk.dll”。如果你遇到错误提示信息，请检查确认这两个文件确实在当前目录下，没有问题则进入下一步。<br/><br/><br/>第三、建立表单。<br/><br/>我们将使用每个人对这个示范都很熟悉的表单。这在“http://www.irs.gov”随意可得并为我们提供足够的领域来展示我们能作的东西。<br/><br/><br/>第四、定义Adobe表单字段。<br/><br/>在Adobe Acrobat中打开文档后选择表单工具，描述你的第一个表单字段（First Name）。<br/><br/>在你定义后它将让你命名，我这里命名为“FirstName”。注意这里有几个标准的附加格式选项，除了字体大小，我选择进行合法性检查和格式化我的ASP文档。由于这是一个快速演示，我选择跳过任何检查，但是我将在客户端的表单进行处理，并在传递变量前在服务端格式化ASP页面。<br/><br/>继续其他字段，每一个都要注意命名并可能格式化字体大小或属性。<br/>在服务器上保存你的修改。<br/><br/><br/>第五、编写ASP页面。<br/><br/>在开始这一步之前你要注意到FDF套装工具阐述的一个主要对象——“FDFApp.FDFApp”。它开放了许多方法，手册上概述了其他的可能方法。我们主要关心两个方法——fdfSetValue和fdfSetFile。接下来切入正题。<br/><br/><br/>第六、没有必要成为PDF专家，这是我目前的建议。套装工具的用户指导概述了所有方法，看上去在这个入门介绍之外还有很多可能的方法。就像你所看到的一样，你可以很容易添加数据库命令来收集数据或向数据库记录数据。</p>
<h2  class="related_post_title">相关博文</h2><ul class="related_post"><li>2011年06月29日 -- <a href="http://www.5bay.cn/me/kaiyuanruanjiandeyinglimoshi.html" title="开源软件的盈利模式">开源软件的盈利模式</a> (0)</li><li>2010年07月28日 -- <a href="http://www.5bay.cn/server-building/aspeaojie.html" title="ASP防注入新方式，希望对大家是有用的">ASP防注入新方式，希望对大家是有用的</a> (0)</li><li>2010年07月28日 -- <a href="http://www.5bay.cn/server-building/eeprn-asp-jpg.html" title="如何删除删不掉的”PRN.asp:.jpg”">如何删除删不掉的”PRN.asp:.jpg”</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajax.html" title="AJAX的各种控件和类库">AJAX的各种控件和类库</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/eejaxeeetpit.html" title="了解Ajax中的Get和Post ">了解Ajax中的Get和Post </a> (0)</li><li>2010年05月23日 -- <a href="http://www.5bay.cn/website/nginxtongguouser-agentpanduanshoujizhongduan.html" title="nginx 通过user-agent判断手机终端">nginx 通过user-agent判断手机终端</a> (0)</li><li>2007年12月29日 -- <a href="http://www.5bay.cn/network-programming/asp/%E7%94%A8%E6%AD%A3%E5%88%99%E8%A7%A3%E6%9E%90%E5%9B%BE%E7%89%87%E5%9C%B0%E5%9D%80%E5%B9%B6%E5%88%A9%E7%94%A8xmlhttp%E7%BB%84%E4%BB%B6%E5%B0%86%E5%85%B6%E4%BF%9D%E5%AD%98.html" title="用正则解析图片地址,并利用XMLHTTP组件将其保存">用正则解析图片地址,并利用XMLHTTP组件将其保存</a> (0)</li><li>2007年12月29日 -- <a href="http://www.5bay.cn/network-programming/asp/%E5%9C%A8asp%E6%96%87%E4%BB%B6%E4%B8%AD%E8%AE%BF%E9%97%AEflash%E8%AF%A6%E7%BB%86%E4%BF%A1%E6%81%AF.html" title="在asp文件中访问flash详细信息">在asp文件中访问flash详细信息</a> (0)</li><li>2007年12月29日 -- <a href="http://www.5bay.cn/network-programming/asp/asp%E5%88%9D%E5%AD%A6%E8%80%85%E5%B8%B8%E7%8A%AF%E7%9A%84%E5%87%A0%E4%B8%AA%E9%94%99%E8%AF%AF.html" title="ASP初学者常犯的几个错误">ASP初学者常犯的几个错误</a> (0)</li><li>2007年12月29日 -- <a href="http://www.5bay.cn/network-programming/asp/%E4%B8%80%E4%B8%AA%E6%96%B0%E7%9A%84jmail%E5%8F%91%E9%80%81%E4%BB%A3%E7%A0%81.html" title="一个新的JMail发送代码">一个新的JMail发送代码</a> (0)</li><li>2007年12月29日 -- <a href="http://www.5bay.cn/network-programming/asp/asp%E6%8F%90%E9%80%9F%E6%8A%80%E5%B7%A7%E4%BA%94%E5%88%99.html" title="ASP提速技巧五则">ASP提速技巧五则</a> (0)</li><li>2007年05月8日 -- <a href="http://www.5bay.cn/network-programming/asp/asp%E7%BC%96%E7%A8%8B%E5%BF%83%E5%BE%97%E5%9B%9E%E6%94%BE.html" title="ASP编程心得回放">ASP编程心得回放</a> (0)</li><li>2007年03月21日 -- <a href="http://www.5bay.cn/network-programming/asp/asp%E8%84%9A%E6%9C%AC%E7%94%9F%E6%88%90guid%E7%9A%84%E5%AE%9E%E7%8E%B0.html" title="ASP脚本生成GUID的实现">ASP脚本生成GUID的实现</a> (0)</li><li>2007年02月9日 -- <a href="http://www.5bay.cn/network-programming/asp/asp%E5%8A%A8%E6%80%81%E5%8C%85%E5%90%AB%E6%96%87%E4%BB%B6.html" title="ASP 动态包含文件">ASP 动态包含文件</a> (0)</li><li>2007年02月9日 -- <a href="http://www.5bay.cn/network-programming/asp/asp%E8%AF%BBsqlserver%E6%95%B0%E6%8D%AE%E5%87%BA%E7%8E%B0%E4%B9%B1%E7%A0%81%E9%97%AE%E9%A2%98%E8%A7%A3%E5%86%B3%E6%96%B9%E6%B3%95.html" title="asp读sql server数据出现乱码问题解决方法">asp读sql server数据出现乱码问题解决方法</a> (0)</li></ul>
	标签Tags：<a href="http://www.5bay.cn/category/network-programming/asp" title="ASP" rel="tag">ASP</a>, <a href="http://www.5bay.cn/tag/asp" title="ASP" rel="tag">ASP</a>, <a href="http://www.5bay.cn/tag/pdf" title="pdf" rel="tag">pdf</a><br />
]]></content:encoded>
			<wfw:commentRss>http://www.5bay.cn/network-programming/asp/%E5%B7%A7%E7%94%A8asp%E7%94%9F%E6%88%90pdf%E6%96%87%E4%BB%B6.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>ASP编程心得回放</title>
		<link>http://www.5bay.cn/network-programming/asp/asp%E7%BC%96%E7%A8%8B%E5%BF%83%E5%BE%97%E5%9B%9E%E6%94%BE.html</link>
		<comments>http://www.5bay.cn/network-programming/asp/asp%E7%BC%96%E7%A8%8B%E5%BF%83%E5%BE%97%E5%9B%9E%E6%94%BE.html#comments</comments>
		<pubDate>Tue, 08 May 2007 18:43:49 +0000</pubDate>
		<dc:creator>江小邪</dc:creator>
				<category><![CDATA[ASP]]></category>
		<category><![CDATA[编程心得]]></category>

		<guid isPermaLink="false">?p=240</guid>
		<description><![CDATA[<a href="http://www.5bay.cn/network-programming/asp/asp%E7%BC%96%E7%A8%8B%E5%BF%83%E5%BE%97%E5%9B%9E%E6%94%BE.html"><img align="left" hspace="5" width="150" height="150" src="http://www.5bay.cn/wp-content/plugins/thumbnail-for-excerpts/tfe_no_thumb.png" class="alignleft wp-post-image tfe" alt="" title="" /></a>　　学好一门编程语言有两个条件是必不可少的，一是理论与实践结合，在实际例程去验证书本上的理论能加深你对理论的理解；二是学会总结，把学习、运用中的心得体会记下来，当成一种经验或者教训加以提炼并在日后的应用中加以改进，一定能提高你对这门编程语言的认识。以下是笔者在学习与运用ASP编程中的两点经验，希望能对大家有所帮助。 　　ASP页面内VBScript和JScript的交互 　　ASP具备管理不同语言脚本程序的能力，能够自动调用合适的脚本引擎以解释脚本代码和执行内置函数。ASP开发环境提供了两种脚本引擎，即VBScript（缺省）和JScript。不过，开发者并没有被限制于只能使用这两种语言，只要能够提供合适的ActiveX脚本引擎就能使用任何脚本语言。 　　脚本语言的选择往往基于许多不同原因：它可能是开发者最为熟悉的语言，可能是对给定工程来说能够提供最多特色支持的，也有可能是最具效率的。不同的环境和要求使得我们在选择脚本语言时注重不同的因素，同时也使得我们在某些时候面临选定的脚本语言不能直接提供其它语言固有的函数这一问题，或某个脚本已经写成但用的却是另外一种脚本语言。 　　此时应该怎么办？是否需要用当前所用的脚本语言重写这些脚本？或者说，是否有可能在一种脚本语言中调用其它脚本语言的内置函数？本文要说明的就是在ASP应用中如何让VBScript脚本和JScript脚本交互以最大限度地获得两种脚本语言的特色支持。 　　一、VBScript和JScript的内置函数 　　在VBScript和JScript中，有大量的内置函数功能是相同或类似的。然而，在一种脚本语言中内置的函数并非总是在另外一种脚本语言中也有对应的函数。例如，VBScript提供了许多用于操作字符串和格式化数据的函数，这些函数在JScript中并不存在。这些函数包括StrReverse()、Filter()以及FormatCurrency()等。在另一方面，JScript所提供的用于管理数组、字符串编码等的函数在VBScript中也没有定义，如join()、reverse()、pow()、位操作、escape()和unescape()等。 　　那么，如果在JScript程序中需要一个VBscript函数该怎么办呢? 　　二、异种脚本的互相调用 　　如果需要在JScript脚本中调用一个VBScript中内置的函数，则应该写一个VBScript用户定义函数（在这里调用VBScript内置函数），然后在JScript脚本中象调用公用JScript函数一样调用这个用户定义函数。 　　例如，如果要调用的VBSCript内置函数是FormatCurrency()，则可以声明如下自定义函数： 程序代码　< SCRIPT LANGUAGE="VBSCRIPT" RUNAT="SERVER"> 　Function FormatValue(Value) 　 FormatValue = FormatCurrency(Value) 　End Function 　< /SCRIPT>　　接下来在JScript代码中就可以象普通JScript函数一样调用FormatValue()了。用类似的方法也可以实现VBScript代码调用JScript函数。 　　应用同样的规则，我们可以在任何脚本内调用任何用户定义函数。不过，从JScript脚本内调用一个不带参数的VBScript过程（Sub）时应略加注意，此时在JScript中应该象调用一个不带参数的JScript函数一样调用它，如用foo()调用VBScript Sub foo过程。 　　三、数据共享 　　在某些情形下混合运用VBScript和JScript函数是非常有用的，但在不同语言脚本之间共享数据也可能很有用。实现这种共享的方法很简单：不管使用的是什么语言，只要是在页面级声明的变量就可以任意引用。 　　对象的使用方法也相似，可以任意选用合适的语言读取、修改属性或调用对象的方法。当然给定对象的属性和方法是由创建该对象实例的语言所定义的。正如上例VBScript的过程调用，当从JScript中调用一个不带参数的VBScript对象的方法时，其调用方法也遵从JScript的调用规则，反之亦然。 　　四、数组管理 　　数组共享问题稍微复杂一点。虽然数组也象其它变量一样可以在不同语言脚本之间共享，但必须注意兼容方面的问题。 　　VBScript数组在JScript下可以用VBScript的符号引用，即用myArray(2)引用数组元素而不是JScript的数组元素引用符号myArray[2]。此外，还可以使用一个特殊的JScript对象——VBArray对象将VBScript数组转换为JScript数组。下面的代码从VBScript数组myVBArray创建JScript数组myJSArray： 程序代码　var Temp = new VBArray(myVBArray) 　var myJSArray 　myJSArray = Temp.toArray()　　上述代码首先创建一个临时的VBArray对象，然后使用它的toArray()方法将自己转换为JScript数组。此后就可以象普通JScript数组一样使用myJSArray，如myJSArray[1]。但应当注意的是，toArray()方法将把一个多维的VBArray转换为一维的JScript数组。 　　从VBScript中引用JScript数组更为复杂。虽然在VBScript中我们可以直接访问JScript数组相关的方法和属性，但没有直接访问JScript数组的单个元素的方法。也就是说，我们可以在VBScript脚本中读取JScript数组的长度属性，如下所示： 程序代码　 x = myJSArray.length　　但无法直接读取该数组的单个元素，下面的VBScript代码是不正确的： 程序代码　　 x = myJSArray(3)　　解决该问题的一个可行的方法是执行一个转换过程，如下面的代码所示，此处假定VBScript是缺省的脚本语言： 程序代码< % [...]]]></description>
			<content:encoded><![CDATA[<p>　　学好一门编程语言有两个条件是必不可少的，一是理论与实践结合，在实际例程去验证书本上的理论能加深你对理论的理解；二是学会总结，把学习、运用中的心得体会记下来，当成一种经验或者教训加以提炼并在日后的应用中加以改进，一定能提高你对这门编程语言的认识。以下是笔者在学习与运用ASP编程中的两点经验，希望能对大家有所帮助。 <span id="more-240"></span><br/><br/>　　ASP页面内VBScript和JScript的交互 <br/><br/>　　ASP具备管理不同语言脚本程序的能力，能够自动调用合适的脚本引擎以解释脚本代码和执行内置函数。ASP开发环境提供了两种脚本引擎，即VBScript（缺省）和JScript。不过，开发者并没有被限制于只能使用这两种语言，只要能够提供合适的ActiveX脚本引擎就能使用任何脚本语言。 <br/><br/>　　脚本语言的选择往往基于许多不同原因：它可能是开发者最为熟悉的语言，可能是对给定工程来说能够提供最多特色支持的，也有可能是最具效率的。不同的环境和要求使得我们在选择脚本语言时注重不同的因素，同时也使得我们在某些时候面临选定的脚本语言不能直接提供其它语言固有的函数这一问题，或某个脚本已经写成但用的却是另外一种脚本语言。 <br/><br/>　　此时应该怎么办？是否需要用当前所用的脚本语言重写这些脚本？或者说，是否有可能在一种脚本语言中调用其它脚本语言的内置函数？本文要说明的就是在ASP应用中如何让VBScript脚本和JScript脚本交互以最大限度地获得两种脚本语言的特色支持。 <br/><br/>　　一、VBScript和JScript的内置函数 <br/><br/>　　在VBScript和JScript中，有大量的内置函数功能是相同或类似的。然而，在一种脚本语言中内置的函数并非总是在另外一种脚本语言中也有对应的函数。例如，VBScript提供了许多用于操作字符串和格式化数据的函数，这些函数在JScript中并不存在。这些函数包括StrReverse()、Filter()以及FormatCurrency()等。在另一方面，JScript所提供的用于管理数组、字符串编码等的函数在VBScript中也没有定义，如join()、reverse()、pow()、位操作、escape()和unescape()等。 <br/><br/>　　那么，如果在JScript程序中需要一个VBscript函数该怎么办呢? <br/><br/>　　二、异种脚本的互相调用 <br/><br/>　　如果需要在JScript脚本中调用一个VBScript中内置的函数，则应该写一个VBScript用户定义函数（在这里调用VBScript内置函数），然后在JScript脚本中象调用公用JScript函数一样调用这个用户定义函数。 <br/><br/>　　例如，如果要调用的VBSCript内置函数是FormatCurrency()，则可以声明如下自定义函数： <br/> 程序代码<br/><br/><coolcode>　< SCRIPT LANGUAGE="VBSCRIPT" RUNAT="SERVER"> <br />　Function FormatValue(Value) <br />　 FormatValue = FormatCurrency(Value) <br />　End Function <br />　< /SCRIPT></coolcode>　　接下来在JScript代码中就可以象普通JScript函数一样调用FormatValue()了。用类似的方法也可以实现VBScript代码调用JScript函数。 <br/><br/>　　应用同样的规则，我们可以在任何脚本内调用任何用户定义函数。不过，从JScript脚本内调用一个不带参数的VBScript过程（Sub）时应略加注意，此时在JScript中应该象调用一个不带参数的JScript函数一样调用它，如用foo()调用VBScript Sub foo过程。 <br/><br/>　　三、数据共享 <br/><br/>　　在某些情形下混合运用VBScript和JScript函数是非常有用的，但在不同语言脚本之间共享数据也可能很有用。实现这种共享的方法很简单：不管使用的是什么语言，只要是在页面级声明的变量就可以任意引用。 <br/><br/>　　对象的使用方法也相似，可以任意选用合适的语言读取、修改属性或调用对象的方法。当然给定对象的属性和方法是由创建该对象实例的语言所定义的。正如上例VBScript的过程调用，当从JScript中调用一个不带参数的VBScript对象的方法时，其调用方法也遵从JScript的调用规则，反之亦然。 <br/><br/>　　四、数组管理 <br/><br/>　　数组共享问题稍微复杂一点。虽然数组也象其它变量一样可以在不同语言脚本之间共享，但必须注意兼容方面的问题。 <br/><br/>　　VBScript数组在JScript下可以用VBScript的符号引用，即用myArray(2)引用数组元素而不是JScript的数组元素引用符号myArray[2]。此外，还可以使用一个特殊的JScript对象——VBArray对象将VBScript数组转换为JScript数组。下面的代码从VBScript数组myVBArray创建JScript数组myJSArray： <br/><br/><coolcode> 程序代码<br />　var Temp = new VBArray(myVBArray) <br />　var myJSArray <br />　myJSArray = Temp.toArray()</coolcode><br/><br/>　　上述代码首先创建一个临时的VBArray对象，然后使用它的toArray()方法将自己转换为JScript数组。此后就可以象普通JScript数组一样使用myJSArray，如myJSArray[1]。但应当注意的是，toArray()方法将把一个多维的VBArray转换为一维的JScript数组。 <br/><br/>　　从VBScript中引用JScript数组更为复杂。虽然在VBScript中我们可以直接访问JScript数组相关的方法和属性，但没有直接访问JScript数组的单个元素的方法。也就是说，我们可以在VBScript脚本中读取JScript数组的长度属性，如下所示： <br/> 程序代码<br/>　 x = myJSArray.length<br/><br/>　　但无法直接读取该数组的单个元素，下面的VBScript代码是不正确的： <br/> 程序代码<br/>　　 x = myJSArray(3)<br/><br/>　　解决该问题的一个可行的方法是执行一个转换过程，如下面的代码所示，此处假定VBScript是缺省的脚本语言： <br/><br/><coolcode> 程序代码<br />< % <br />　　Dim Temp <br />　　Dim myVBArray <br />　　Temp = myJSArray.join(“, “) <br />　　myVBArray = Split(Temp, “, “) <br />%> </coolcode><br/><br/>　　此处的JScript join()方法将数组myJSArray元素转换到一个以逗号为分割符的字符串，VBScript Split()函数将字符串转换为VBScript数组。注意这里我们是在VBScript环境下调用JScript的join方法。依照此例，我们可以通过自定义VBScript函数来模拟JScript的VBArray对象的toArray()方法以实现JScript数组到VBScript数组的转换。 <br/><br/>用模板建立动态ASP页 <br/><br/>　　对于模板，我想大家可能都有一些概念，在word中很多模板，设计好了大概的版面，你只要用你自己的话填充那些占位字符就好了。这儿的模板大概也就是这个意思，页面中相对稳定的部分固定下来，其他的部分根不同的情况在输入不同的内容。其实在DreamWeaver中也有模板的功能，不过那个静态的，只能手动填充内容，而这儿讲的是动态的自动的内容填充。 <br/><br/>　　首先，我先来解释一下为什么要用到模板文件。有时候，模板能够带给你对网页功能和布局更为完整的概念。当你看到Word的模板格式之后，就知道最后版面是个什么样子的了，在这儿也是如此。例如，你可以保留ASP语句，而使用不同的模板来建立不同的页面风格。<br/><br/>　　这样，你就不用为每种不同风格的网页分别来写不同的ASP页面了，这显然可以为我们节省很多时间和精力。而且，模板文件能够让你更容易的浏览页面代码，不用担心ASP和HTML的混杂搞的你头昏脑胀。你可以只用把注意力集中在HTML上，而完全不用去管ASP了。再有就是，摸板很简单，你绝对很快就能搞懂搞定。在这篇文章中，将会用到一个数据库——一个用的很广泛的雇员表。包括雇员ID，姓名，照片，以及工作摘要和照片的注脚。下面是这个Access数据库的结构: <br/><br/><coolcode> 程序代码<br />文件名 &#8211; myDatabase.mdb <br />表名 &#8211; Employees <br />ID <br />自动计数(Autonumber) <br />FullName <br />文本 &#8211; 最多100个字符 <br />PicURL <br />文本 &#8211; 最多255个字符 <br />Duties <br />注释类型 <br />PicCaption <br />文本 &#8211; 最多50个字符</coolcode><br/><br/>　　一个很简单的数据库，是吧。当然你可以按要求来扩展它，那就是你自己的事了。我假设你已了解数据库的基本操作，这样我不用在这上面花太多的笔墨，其实这儿的代码都是很简单的，只要你知道一些基本的东西，就能把它看懂。建立了数据库之后，我们可以开始建立模板文件了。这个文件是每个页面的骨架。我没有用到表格，那样有些麻烦，而我很懒，而且，也不用加入,标签，因为那是要加在ASP页面中的。所以到最后，它的样子就是这样了： <br/><br/><coolcode> 程序代码<br />Full Name: <br />%name% < br>Description of duties: </p>
<p>%duties% </p>
<p>This picture was taken: %date% </p>
<p>Employee ID: %empID% </coolcode><br/><br/>　　就是这样了！这就是一个简单的模板。把它存为template.tmp，在后面的ASP页面中将要引用到它。要注意的是：我们可以在模板中加入各种HTML标签，你完全可以在摸版中定义好网页的结构和样式，就像实际写一个网页一样，只是要把关键的地方标出来——注意到了那些%围着的东西了吗？那就是模板的精髓了。或许你已经注意到，那些%围着的是和数据库中的字段意义对应的。看看下面的ASP代码，是如何读入模板和数据库文件，把他们揉和在一起，然后输出我们想要的HTML页面。 <br/><br/>　　这就是所有的代码了，很简单，不是吗？它所作的只是打开模板文件，按顺序读入每一行，然后用冲数据库中读入的实际的字段值来代替模版中那些%img%，%name%标记。而且，它还把在“Duties”字段内大段文本中的回车解释成HTML的回车 ，这样就不至于打乱整个的排版格式了。怎么样？轻松搞定吧。模板在某些应用上真的是可以发挥奇效，省时省力。理论上，你还可以修改这段代码，用FileSystemObject来读写文本，这样数据就不一定要存储在数据库中了。在一些应用中，比如即时的新闻发布，这样也许更为方便一些。<br/></p>
<h2  class="related_post_title">相关博文</h2><ul class="related_post"><li>2011年06月29日 -- <a href="http://www.5bay.cn/me/kaiyuanruanjiandeyinglimoshi.html" title="开源软件的盈利模式">开源软件的盈利模式</a> (0)</li><li>2010年07月28日 -- <a href="http://www.5bay.cn/server-building/aspeaojie.html" title="ASP防注入新方式，希望对大家是有用的">ASP防注入新方式，希望对大家是有用的</a> (0)</li><li>2010年07月28日 -- <a href="http://www.5bay.cn/server-building/eeprn-asp-jpg.html" title="如何删除删不掉的”PRN.asp:.jpg”">如何删除删不掉的”PRN.asp:.jpg”</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajax.html" title="AJAX的各种控件和类库">AJAX的各种控件和类库</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/eejaxeeetpit.html" title="了解Ajax中的Get和Post ">了解Ajax中的Get和Post </a> (0)</li><li>2010年05月23日 -- <a href="http://www.5bay.cn/website/nginxtongguouser-agentpanduanshoujizhongduan.html" title="nginx 通过user-agent判断手机终端">nginx 通过user-agent判断手机终端</a> (0)</li><li>2007年12月29日 -- <a href="http://www.5bay.cn/network-programming/asp/%E7%94%A8%E6%AD%A3%E5%88%99%E8%A7%A3%E6%9E%90%E5%9B%BE%E7%89%87%E5%9C%B0%E5%9D%80%E5%B9%B6%E5%88%A9%E7%94%A8xmlhttp%E7%BB%84%E4%BB%B6%E5%B0%86%E5%85%B6%E4%BF%9D%E5%AD%98.html" title="用正则解析图片地址,并利用XMLHTTP组件将其保存">用正则解析图片地址,并利用XMLHTTP组件将其保存</a> (0)</li><li>2007年12月29日 -- <a href="http://www.5bay.cn/network-programming/asp/%E5%9C%A8asp%E6%96%87%E4%BB%B6%E4%B8%AD%E8%AE%BF%E9%97%AEflash%E8%AF%A6%E7%BB%86%E4%BF%A1%E6%81%AF.html" title="在asp文件中访问flash详细信息">在asp文件中访问flash详细信息</a> (0)</li><li>2007年12月29日 -- <a href="http://www.5bay.cn/network-programming/asp/asp%E5%88%9D%E5%AD%A6%E8%80%85%E5%B8%B8%E7%8A%AF%E7%9A%84%E5%87%A0%E4%B8%AA%E9%94%99%E8%AF%AF.html" title="ASP初学者常犯的几个错误">ASP初学者常犯的几个错误</a> (0)</li><li>2007年12月29日 -- <a href="http://www.5bay.cn/network-programming/asp/%E4%B8%80%E4%B8%AA%E6%96%B0%E7%9A%84jmail%E5%8F%91%E9%80%81%E4%BB%A3%E7%A0%81.html" title="一个新的JMail发送代码">一个新的JMail发送代码</a> (0)</li><li>2007年12月29日 -- <a href="http://www.5bay.cn/network-programming/asp/asp%E6%8F%90%E9%80%9F%E6%8A%80%E5%B7%A7%E4%BA%94%E5%88%99.html" title="ASP提速技巧五则">ASP提速技巧五则</a> (0)</li><li>2007年12月29日 -- <a href="http://www.5bay.cn/network-programming/asp/%E5%B7%A7%E7%94%A8asp%E7%94%9F%E6%88%90pdf%E6%96%87%E4%BB%B6.html" title="巧用ASP生成PDF文件">巧用ASP生成PDF文件</a> (1)</li><li>2007年03月21日 -- <a href="http://www.5bay.cn/network-programming/asp/asp%E8%84%9A%E6%9C%AC%E7%94%9F%E6%88%90guid%E7%9A%84%E5%AE%9E%E7%8E%B0.html" title="ASP脚本生成GUID的实现">ASP脚本生成GUID的实现</a> (0)</li><li>2007年02月9日 -- <a href="http://www.5bay.cn/network-programming/asp/asp%E5%8A%A8%E6%80%81%E5%8C%85%E5%90%AB%E6%96%87%E4%BB%B6.html" title="ASP 动态包含文件">ASP 动态包含文件</a> (0)</li><li>2007年02月9日 -- <a href="http://www.5bay.cn/network-programming/asp/asp%E8%AF%BBsqlserver%E6%95%B0%E6%8D%AE%E5%87%BA%E7%8E%B0%E4%B9%B1%E7%A0%81%E9%97%AE%E9%A2%98%E8%A7%A3%E5%86%B3%E6%96%B9%E6%B3%95.html" title="asp读sql server数据出现乱码问题解决方法">asp读sql server数据出现乱码问题解决方法</a> (0)</li></ul>
	标签Tags：<a href="http://www.5bay.cn/category/network-programming/asp" title="ASP" rel="tag">ASP</a>, <a href="http://www.5bay.cn/tag/asp" title="ASP" rel="tag">ASP</a>, <a href="http://www.5bay.cn/tag/%E7%BC%96%E7%A8%8B%E5%BF%83%E5%BE%97" title="编程心得" rel="tag">编程心得</a><br />
]]></content:encoded>
			<wfw:commentRss>http://www.5bay.cn/network-programming/asp/asp%E7%BC%96%E7%A8%8B%E5%BF%83%E5%BE%97%E5%9B%9E%E6%94%BE.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ASP脚本生成GUID的实现</title>
		<link>http://www.5bay.cn/network-programming/asp/asp%E8%84%9A%E6%9C%AC%E7%94%9F%E6%88%90guid%E7%9A%84%E5%AE%9E%E7%8E%B0.html</link>
		<comments>http://www.5bay.cn/network-programming/asp/asp%E8%84%9A%E6%9C%AC%E7%94%9F%E6%88%90guid%E7%9A%84%E5%AE%9E%E7%8E%B0.html#comments</comments>
		<pubDate>Wed, 21 Mar 2007 19:31:08 +0000</pubDate>
		<dc:creator>江小邪</dc:creator>
				<category><![CDATA[ASP]]></category>
		<category><![CDATA[guid]]></category>
		<category><![CDATA[脚本生成]]></category>

		<guid isPermaLink="false">?p=213</guid>
		<description><![CDATA[<a href="http://www.5bay.cn/network-programming/asp/asp%E8%84%9A%E6%9C%AC%E7%94%9F%E6%88%90guid%E7%9A%84%E5%AE%9E%E7%8E%B0.html"><img align="left" hspace="5" width="150" height="150" src="http://www.5bay.cn/wp-content/plugins/thumbnail-for-excerpts/tfe_no_thumb.png" class="alignleft wp-post-image tfe" alt="" title="" /></a>　　全球唯一标识符 (GUID) 是一个字母数字标识符，用于指示产品的唯一性安装。在许多流行软件应用程序（例如 Web 浏览器和媒体播放器）中，都使用 GUID。　　GUID 的格式为“xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx”，其中每个 x 是 0-9 或 a-f 范围内的一个十六进制的数字。例如：6F9619FF-8B86-D011-B42D-00C04FC964FF 即为有效的 GUID 值。　　世界上的任何两台计算机都不会生成重复的 GUID 值。GUID 主要用于在拥有多个节点、多台计算机的网络或系统中，分配必须具有唯一性的标识符。在 Windows 平台上，GUID 应用非常广泛：注册表、类及接口标识、数据库、甚至自动生成的机器名、目录名等。　　ASP生成GUDI的实现　　&#60;%　　Dim objTypeLib　　Set objTypeLib = CreateObject(&#34;Scriptlet.TypeLib&#34;)　　Response.Write objTypeLib.Guid　　%&#62;　　在本机及网络主机均测试通过。 相关博文2011年06月29日 -- 开源软件的盈利模式 (0)2010年07月28日 -- ASP防注入新方式，希望对大家是有用的 (0)2010年07月28日 -- 如何删除删不掉的”PRN.asp:.jpg” (0)2010年07月26日 -- AJAX的各种控件和类库 (0)2010年07月26日 -- 了解Ajax中的Get和Post (0)2010年05月23日 -- nginx 通过user-agent判断手机终端 (0)2007年12月29日 -- 用正则解析图片地址,并利用XMLHTTP组件将其保存 (0)2007年12月29日 -- 在asp文件中访问flash详细信息 (0)2007年12月29日 -- ASP初学者常犯的几个错误 [...]]]></description>
			<content:encoded><![CDATA[<p>　　全球唯一标识符 (GUID) 是一个字母数字标识符，用于指示产品的唯一性安装。在许多流行软件应用程序（例如 <a href="http://www.5bay.cn/tag/web" class="st_tag internal_tag" rel="tag" title="标签 web 下的日志">Web</a> 浏览器和媒体播放器）中，都使用 GUID。<br/><br/>　　GUID 的格式为“xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx”，其中每个 x 是 0-9 或 a-f 范围内的一个十六进制的数字。例如：6F9619FF-8B86-D011-B42D-00C04FC964FF 即为有效的 GUID 值。<br/><br/>　　世界上的任何两台计算机都不会生成重复的 GUID 值。GUID 主要用于在拥有多个节点、多台计算机的网络或系统中，分配必须具有唯一性的标识符。在 Windows 平台上，GUID 应用非常广泛：注册表、类及接口标识、<a href="http://www.5bay.cn/tag/%E6%95%B0%E6%8D%AE%E5%BA%93" class="st_tag internal_tag" rel="tag" title="标签 数据库 下的日志">数据库</a>、甚至自动生成的机器名、目录名等。<br/><br/>　　ASP生成GUDI的实现<br/><br/>　　&lt;%<br/><br/>　　Dim objTypeLib<br/><br/>　　Set objTypeLib = CreateObject(&quot;Scriptlet.TypeLib&quot;)<br/><br/>　　Response.Write objTypeLib.Guid<br/><br/>　　%&gt;<br/><br/>　　在本机及网络主机均测试通过。<br/><br/></p>
<h2  class="related_post_title">相关博文</h2><ul class="related_post"><li>2011年06月29日 -- <a href="http://www.5bay.cn/me/kaiyuanruanjiandeyinglimoshi.html" title="开源软件的盈利模式">开源软件的盈利模式</a> (0)</li><li>2010年07月28日 -- <a href="http://www.5bay.cn/server-building/aspeaojie.html" title="ASP防注入新方式，希望对大家是有用的">ASP防注入新方式，希望对大家是有用的</a> (0)</li><li>2010年07月28日 -- <a href="http://www.5bay.cn/server-building/eeprn-asp-jpg.html" title="如何删除删不掉的”PRN.asp:.jpg”">如何删除删不掉的”PRN.asp:.jpg”</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajax.html" title="AJAX的各种控件和类库">AJAX的各种控件和类库</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/eejaxeeetpit.html" title="了解Ajax中的Get和Post ">了解Ajax中的Get和Post </a> (0)</li><li>2010年05月23日 -- <a href="http://www.5bay.cn/website/nginxtongguouser-agentpanduanshoujizhongduan.html" title="nginx 通过user-agent判断手机终端">nginx 通过user-agent判断手机终端</a> (0)</li><li>2007年12月29日 -- <a href="http://www.5bay.cn/network-programming/asp/%E7%94%A8%E6%AD%A3%E5%88%99%E8%A7%A3%E6%9E%90%E5%9B%BE%E7%89%87%E5%9C%B0%E5%9D%80%E5%B9%B6%E5%88%A9%E7%94%A8xmlhttp%E7%BB%84%E4%BB%B6%E5%B0%86%E5%85%B6%E4%BF%9D%E5%AD%98.html" title="用正则解析图片地址,并利用XMLHTTP组件将其保存">用正则解析图片地址,并利用XMLHTTP组件将其保存</a> (0)</li><li>2007年12月29日 -- <a href="http://www.5bay.cn/network-programming/asp/%E5%9C%A8asp%E6%96%87%E4%BB%B6%E4%B8%AD%E8%AE%BF%E9%97%AEflash%E8%AF%A6%E7%BB%86%E4%BF%A1%E6%81%AF.html" title="在asp文件中访问flash详细信息">在asp文件中访问flash详细信息</a> (0)</li><li>2007年12月29日 -- <a href="http://www.5bay.cn/network-programming/asp/asp%E5%88%9D%E5%AD%A6%E8%80%85%E5%B8%B8%E7%8A%AF%E7%9A%84%E5%87%A0%E4%B8%AA%E9%94%99%E8%AF%AF.html" title="ASP初学者常犯的几个错误">ASP初学者常犯的几个错误</a> (0)</li><li>2007年12月29日 -- <a href="http://www.5bay.cn/network-programming/asp/%E4%B8%80%E4%B8%AA%E6%96%B0%E7%9A%84jmail%E5%8F%91%E9%80%81%E4%BB%A3%E7%A0%81.html" title="一个新的JMail发送代码">一个新的JMail发送代码</a> (0)</li><li>2007年12月29日 -- <a href="http://www.5bay.cn/network-programming/asp/asp%E6%8F%90%E9%80%9F%E6%8A%80%E5%B7%A7%E4%BA%94%E5%88%99.html" title="ASP提速技巧五则">ASP提速技巧五则</a> (0)</li><li>2007年12月29日 -- <a href="http://www.5bay.cn/network-programming/asp/%E5%B7%A7%E7%94%A8asp%E7%94%9F%E6%88%90pdf%E6%96%87%E4%BB%B6.html" title="巧用ASP生成PDF文件">巧用ASP生成PDF文件</a> (1)</li><li>2007年05月8日 -- <a href="http://www.5bay.cn/network-programming/asp/asp%E7%BC%96%E7%A8%8B%E5%BF%83%E5%BE%97%E5%9B%9E%E6%94%BE.html" title="ASP编程心得回放">ASP编程心得回放</a> (0)</li><li>2007年02月9日 -- <a href="http://www.5bay.cn/network-programming/asp/asp%E5%8A%A8%E6%80%81%E5%8C%85%E5%90%AB%E6%96%87%E4%BB%B6.html" title="ASP 动态包含文件">ASP 动态包含文件</a> (0)</li><li>2007年02月9日 -- <a href="http://www.5bay.cn/network-programming/asp/asp%E8%AF%BBsqlserver%E6%95%B0%E6%8D%AE%E5%87%BA%E7%8E%B0%E4%B9%B1%E7%A0%81%E9%97%AE%E9%A2%98%E8%A7%A3%E5%86%B3%E6%96%B9%E6%B3%95.html" title="asp读sql server数据出现乱码问题解决方法">asp读sql server数据出现乱码问题解决方法</a> (0)</li></ul>
	标签Tags：<a href="http://www.5bay.cn/category/network-programming/asp" title="ASP" rel="tag">ASP</a>, <a href="http://www.5bay.cn/tag/asp" title="ASP" rel="tag">ASP</a>, <a href="http://www.5bay.cn/tag/guid" title="guid" rel="tag">guid</a>, <a href="http://www.5bay.cn/tag/%E8%84%9A%E6%9C%AC%E7%94%9F%E6%88%90" title="脚本生成" rel="tag">脚本生成</a><br />
]]></content:encoded>
			<wfw:commentRss>http://www.5bay.cn/network-programming/asp/asp%E8%84%9A%E6%9C%AC%E7%94%9F%E6%88%90guid%E7%9A%84%E5%AE%9E%E7%8E%B0.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ASP 动态包含文件</title>
		<link>http://www.5bay.cn/network-programming/asp/asp%E5%8A%A8%E6%80%81%E5%8C%85%E5%90%AB%E6%96%87%E4%BB%B6.html</link>
		<comments>http://www.5bay.cn/network-programming/asp/asp%E5%8A%A8%E6%80%81%E5%8C%85%E5%90%AB%E6%96%87%E4%BB%B6.html#comments</comments>
		<pubDate>Fri, 09 Feb 2007 20:00:14 +0000</pubDate>
		<dc:creator>江小邪</dc:creator>
				<category><![CDATA[ASP]]></category>
		<category><![CDATA[include]]></category>
		<category><![CDATA[动态包含文件]]></category>

		<guid isPermaLink="false">?p=201</guid>
		<description><![CDATA[<a href="http://www.5bay.cn/network-programming/asp/asp%E5%8A%A8%E6%80%81%E5%8C%85%E5%90%AB%E6%96%87%E4%BB%B6.html"><img align="left" hspace="5" width="150" height="150" src="http://www.5bay.cn/wp-content/plugins/thumbnail-for-excerpts/tfe_no_thumb.png" class="alignleft wp-post-image tfe" alt="" title="" /></a>ASP 本身不支持动态包含文件，现在的动态包含是通过 FSO 把被包含的文件合并到主文件里再运行。以下也有把形如 &#60;!&#8211;#include file=&#34;filename.asp&#34; &#8211;&#62; 的普通包含文件方式称作“传统引用”，用函数实现的动态包含文件称作“动态引用”。常见的程序如下：Function include(filename) Dim re,content,fso,f,aspStart,aspEnd set fso=CreateObject(&#34;Scripting.FileSystemObject&#34;) set f=fso.OpenTextFile(server.mappath(filename)) content=f.ReadAll f.close set f=nothing set fso=nothing set re=new RegExp re.pattern=&#34;^&#92;s*=&#34; aspEnd=1 aspStart=inStr(aspEnd,content,&#34;&#60;%&#34;)+2 do while aspStart&#62;aspEnd+1 &#160;Response.write Mid(content,aspEnd,aspStart-aspEnd-2) &#160;aspEnd=inStr(aspStart,content,&#34;%&#92;&#62;&#34;)+2 &#160;Execute(re.replace(Mid(content,aspStart,aspEnd-aspStart-2),&#34;Response.Write &#34;)) &#160;aspStart=inStr(aspEnd,content,&#34;&#60;%&#34;)+2 loop Response.write Mid(content,aspEnd) set re=nothingEnd Function使用范例：include(&#34;youinc.asp&#34;)以上范例引自 http://www.blueidea.com/tech/program/2003/101.asp但这处函数在处理补包含的文件中还有包含文件时就不灵了。我在以上函数的基础上改进出来如下函数，在被包含文件中还有普通的包含文件 &#60;!&#8211;#include file=&#34;filename.asp&#34; &#8211;&#62; 也可正常运行。Function includeconvert(oRegExp, strFilename, strBlock) Dim incStart, incEnd, match, oMatches, [...]]]></description>
			<content:encoded><![CDATA[<p><br/><a href="http://www.5bay.cn/tag/asp" class="st_tag internal_tag" rel="tag" title="标签 ASP 下的日志">ASP</a> 本身不支持动态包含文件，现在的动态包含是通过 FSO 把被包含的文件合并到主文件里再运行。以下也有把形如 &lt;!&#8211;#<a href="http://www.5bay.cn/tag/include" class="st_tag internal_tag" rel="tag" title="标签 include 下的日志">include</a> file=&quot;filename.asp&quot; &#8211;&gt; 的普通包含文件方式称作“传统引用”，用函数实现的动态包含文件称作“动态引用”。常见的程序如下：<br/>Function include(filename)<br/> Dim re,content,fso,f,aspStart,aspEnd<br/> <br/> set fso=CreateObject(&quot;Scripting.FileSystemObject&quot;)<br/> set f=fso.OpenTextFile(<a href="http://www.5bay.cn/tag/server" class="st_tag internal_tag" rel="tag" title="标签 server 下的日志">server</a>.mappath(filename))<br/> content=f.ReadAll<br/> f.close<br/> set f=nothing<br/> set fso=nothing<br/> <br/> set re=new RegExp<br/> re.pattern=&quot;^&#92;s*=&quot;<br/> aspEnd=1<br/> aspStart=inStr(aspEnd,content,&quot;&lt;%&quot;)+2<br/> do while aspStart&gt;aspEnd+1 <br/> &nbsp;Response.write Mid(content,aspEnd,aspStart-aspEnd-2)<br/> &nbsp;aspEnd=inStr(aspStart,content,&quot;%&#92;&gt;&quot;)+2<br/> &nbsp;Execute(re.replace(Mid(content,aspStart,aspEnd-aspStart-2),&quot;Response.Write &quot;))<br/> &nbsp;aspStart=inStr(aspEnd,content,&quot;&lt;%&quot;)+2<br/> loop<br/> Response.write Mid(content,aspEnd) <br/> set re=nothing<br/>End Function<br/><br/>使用范例：include(&quot;youinc.asp&quot;)<br/><br/>以上范例引自 http://www.blueidea.com/tech/program/2003/101.asp<span id="more-201"></span><br/><br/>但这处函数在处理补包含的文件中还有包含文件时就不灵了。我在以上函数的基础上改进出来如下函数，在被包含文件中还有普通的包含文件 &lt;!&#8211;#include file=&quot;filename.asp&quot; &#8211;&gt; 也可正常运行。<br/><br/>Function includeconvert(oRegExp, strFilename, strBlock)<br/> Dim incStart, incEnd, match, oMatches, str, <a href="http://www.5bay.cn/tag/code" class="st_tag internal_tag" rel="tag" title="标签 code 下的日志">code</a><br/> &#039;用提取ASP代码的相同方式提取出include 部分的文件名，其余部分原样输出<br/> code = &quot;&quot;<br/> incEnd = 1<br/> incStart = InStr(incEnd,strBlock,&quot;&lt;!&#8211;#include &quot;) + 13 &#039;要找个目标字符串&lt;!&#8211;#include 正好是13个字符，所以要+13<br/> Do While incStart&gt;incEnd+12 &#039;两个引用间距最小就是连续的&#8211;&gt;&lt;&#8211;#，incStart是从&lt;!&#8211;#include起数13个字符，所以要比前一个incEnd要至少多 13-1 得到的&gt;incEnd+12的条件<br/> &nbsp;str = Mid(strBlock,incEnd,incStart-incEnd-13)<br/> &nbsp;str = Replace(str, &quot;&quot;&quot;&quot;, &quot;&quot;&quot;&quot;&quot;&quot;) &#039;把单个双引号换成两个双引号<br/> &nbsp;str = Replace(str, VbCr, &quot;&quot;)<br/> &nbsp;str = Replace(str, VbLf, &quot;&quot;)<br/> &nbsp;str = Replace(str, VbCrLf, &quot;&quot;)<br/> &nbsp;code = code &amp; VbCrLf &amp; &quot;Response.Write &quot;&quot;&quot; &amp; str &amp; &quot;&quot;&quot;&quot;<br/> &nbsp;incEnd=InStr(incStart,strBlock,&quot;&#8211;&gt;&quot;)+3<br/> &nbsp;oRegExp.pattern=&quot;(&#92;w+)=&quot;&quot;([^&quot;&quot;]+)&quot;&quot;&quot; &#039;匹配 file=&quot;filename.ext&quot; 或 virtual=&quot;virtualname.ext&quot;，捕捉类型及文件名两个子串<br/> &nbsp;Set oMatches = oRegExp.Execute(Mid(strBlock,incStart,incEnd-incStart-3))<br/> &nbsp;Set match = oMatches(0) &#039;确定只有一组捕捉时，要得到这一组匹配的子串，可以这样做，省去用 For Each match In oMatches …… Next<br/> &nbsp;code = code &amp; include(Mid(strFilename, 1, InStrRev(strFilename, &quot;/&quot;)) &amp; match.SubMatches(1)) &#039;Mid(filename, 1, InStrRev(filename, &quot;/&quot;)) 是在被引用的子文件名有路径时,把路径提取出来,加在子文件中传统引用的文件名前面,以找到正确的打开文件路径,因为动态引用时的文件路径是相对主文件而言的。要第二个匹配子串用SubMatches(1)<br/> &nbsp;incStart = InStr(incEnd,strBlock,&quot;&lt;!&#8211;#include &quot;)+13<br/> Loop<br/> str = Mid(strBlock,incEnd)<br/> str = Replace(str, &quot;&quot;&quot;&quot;, &quot;&quot;&quot;&quot;&quot;&quot;) &#039;把单个双引号换成两个双引号<br/> str = Replace(str, VbCr, &quot;&quot;)<br/> str = Replace(str, VbLf, &quot;&quot;)<br/> str = Replace(str, VbCrLf, &quot;&quot;)<br/> code = code &amp; VbCrLf &amp; &quot;Response.Write &quot;&quot;&quot; &amp; str &amp; &quot;&quot;&quot;&quot;<br/> includeconvert = code<br/>End Function<br/>Function include(filename)<br/> Dim re, content, fso, f, aspStart, aspEnd, code<br/> Set fso=CreateObject(&quot;scripting.FileSystemObject&quot;)<br/> Set f=fso.OpenTextFile(Server.MapPath(filename))<br/> content=f.ReadAll<br/> f.close<br/> Set f=nothing<br/> Set fso=nothing<br/><br/> code = &quot;&quot;<br/> aspEnd=1<br/> aspStart=InStr(aspEnd,content,&quot;&lt;%&quot;)+2<br/> Set re=new RegExp<br/> Do While aspStart&gt;aspEnd+1<br/> &nbsp;&#039;传统引用&lt;!&#8211;#inclde 肯定是在ASP代码段以外的，所以先转。<br/> &nbsp;code = code &amp; includeconvert (re, filename, Mid(content,aspEnd,aspStart-aspEnd-2))<br/> &nbsp;aspEnd=InStr(aspStart,content,&quot;%&#92;&gt;&quot;)+2<br/> &nbsp;re.pattern=&quot;^&#92;s*=&quot; &#039;这段正则替换原来是把 &lt;% = str % &gt; 换回成标准的 &lt;%Response.Write str % &gt;<br/> &nbsp;code = code &amp; VbCrLf &amp; re.replace(Mid(content,aspStart,aspEnd-aspStart-2),&quot;Response.Write &quot;) &#039;ASP块前面再加回车换行，以避免连接块之间多个 Response.Write在同一行的错误<br/> &nbsp;aspStart=InStr(aspEnd,content,&quot;&lt;%&quot;)+2<br/> Loop<br/> code = code &amp; includeconvert (re, filename, Mid(content,aspEnd))<br/> Set re=nothing<br/> include = code<br/>End Function<br/><br/>方便起见，以上函数最终返回的是整合了包含文件的整个 ASP <a href="http://www.5bay.cn/tag/%E4%BB%A3%E7%A0%81" class="st_tag internal_tag" rel="tag" title="标签 代码 下的日志">代码</a>，使用时还要再用 Execute 执行之，即使用时需要：Execute(include(&quot;file.asp&quot;))。<br/><br/>以上函数对被包含文件与主文件同一路径时测试通过，未对被包含文件与主文件路径不同的情况做进一步容错，时间有限，欢迎有兴趣的朋友提出意见和改进。 <br/><br/></p>
<h2  class="related_post_title">相关博文</h2><ul class="related_post"><li>2011年06月29日 -- <a href="http://www.5bay.cn/me/kaiyuanruanjiandeyinglimoshi.html" title="开源软件的盈利模式">开源软件的盈利模式</a> (0)</li><li>2010年08月17日 -- <a href="http://www.5bay.cn/server-building/nginxxiansu.html" title="Nginx限速">Nginx限速</a> (0)</li><li>2010年07月28日 -- <a href="http://www.5bay.cn/server-building/aspeaojie.html" title="ASP防注入新方式，希望对大家是有用的">ASP防注入新方式，希望对大家是有用的</a> (0)</li><li>2010年07月28日 -- <a href="http://www.5bay.cn/server-building/eeprn-asp-jpg.html" title="如何删除删不掉的”PRN.asp:.jpg”">如何删除删不掉的”PRN.asp:.jpg”</a> (0)</li><li>2010年07月28日 -- <a href="http://www.5bay.cn/server-building/webshelleechueeee.html" title="Webshell下破解计算机管理员密码">Webshell下破解计算机管理员密码</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/eeeeeeee.html" title="最令PHP初学者头痛的十四个问题">最令PHP初学者头痛的十四个问题</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/requireeecludexi.html" title="require和include的异同">require和include的异同</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajax.html" title="AJAX的各种控件和类库">AJAX的各种控件和类库</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/eejaxeeetpit.html" title="了解Ajax中的Get和Post ">了解Ajax中的Get和Post </a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/phpeezhanchang.html" title="PHP安全之数据过滤">PHP安全之数据过滤</a> (0)</li><li>2010年05月23日 -- <a href="http://www.5bay.cn/server-building/rsyncxiangjie.html" title="Rsync详解">Rsync详解</a> (0)</li><li>2010年05月23日 -- <a href="http://www.5bay.cn/server-building/nginxderewriteguize.html" title="nginx的rewrite规则">nginx的rewrite规则</a> (1)</li><li>2010年05月23日 -- <a href="http://www.5bay.cn/website/nginxtongguouser-agentpanduanshoujizhongduan.html" title="nginx 通过user-agent判断手机终端">nginx 通过user-agent判断手机终端</a> (0)</li><li>2008年10月17日 -- <a href="http://www.5bay.cn/game-development/%E4%B8%8D%E9%82%A3%E4%B9%88%E9%9A%8F%E6%9C%BA%E7%9A%84%E9%9A%8F%E6%9C%BA%E6%95%B0%E5%88%97.html" title="不那么随机的随机数列">不那么随机的随机数列</a> (0)</li><li>2007年12月29日 -- <a href="http://www.5bay.cn/network-programming/asp/%E7%94%A8%E6%AD%A3%E5%88%99%E8%A7%A3%E6%9E%90%E5%9B%BE%E7%89%87%E5%9C%B0%E5%9D%80%E5%B9%B6%E5%88%A9%E7%94%A8xmlhttp%E7%BB%84%E4%BB%B6%E5%B0%86%E5%85%B6%E4%BF%9D%E5%AD%98.html" title="用正则解析图片地址,并利用XMLHTTP组件将其保存">用正则解析图片地址,并利用XMLHTTP组件将其保存</a> (0)</li></ul>
	标签Tags：<a href="http://www.5bay.cn/category/network-programming/asp" title="ASP" rel="tag">ASP</a>, <a href="http://www.5bay.cn/tag/asp" title="ASP" rel="tag">ASP</a>, <a href="http://www.5bay.cn/tag/include" title="include" rel="tag">include</a>, <a href="http://www.5bay.cn/tag/%E5%8A%A8%E6%80%81%E5%8C%85%E5%90%AB%E6%96%87%E4%BB%B6" title="动态包含文件" rel="tag">动态包含文件</a><br />
]]></content:encoded>
			<wfw:commentRss>http://www.5bay.cn/network-programming/asp/asp%E5%8A%A8%E6%80%81%E5%8C%85%E5%90%AB%E6%96%87%E4%BB%B6.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>asp读sql server数据出现乱码问题解决方法</title>
		<link>http://www.5bay.cn/network-programming/asp/asp%E8%AF%BBsqlserver%E6%95%B0%E6%8D%AE%E5%87%BA%E7%8E%B0%E4%B9%B1%E7%A0%81%E9%97%AE%E9%A2%98%E8%A7%A3%E5%86%B3%E6%96%B9%E6%B3%95.html</link>
		<comments>http://www.5bay.cn/network-programming/asp/asp%E8%AF%BBsqlserver%E6%95%B0%E6%8D%AE%E5%87%BA%E7%8E%B0%E4%B9%B1%E7%A0%81%E9%97%AE%E9%A2%98%E8%A7%A3%E5%86%B3%E6%96%B9%E6%B3%95.html#comments</comments>
		<pubDate>Fri, 09 Feb 2007 19:52:57 +0000</pubDate>
		<dc:creator>江小邪</dc:creator>
				<category><![CDATA[ASP]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[出现乱码]]></category>
		<category><![CDATA[数据]]></category>
		<category><![CDATA[解决方法]]></category>

		<guid isPermaLink="false">?p=200</guid>
		<description><![CDATA[<a href="http://www.5bay.cn/network-programming/asp/asp%E8%AF%BBsqlserver%E6%95%B0%E6%8D%AE%E5%87%BA%E7%8E%B0%E4%B9%B1%E7%A0%81%E9%97%AE%E9%A2%98%E8%A7%A3%E5%86%B3%E6%96%B9%E6%B3%95.html"><img align="left" hspace="5" width="150" height="150" src="http://www.5bay.cn/wp-content/plugins/thumbnail-for-excerpts/tfe_no_thumb.png" class="alignleft wp-post-image tfe" alt="" title="" /></a>最近在做网站的时候，遇到这么一个奇怪的问题，无法正确执行sql语句，response了一下，原来sql语句里面的中文字段都成了乱码，怀疑是编码的问题，但是怎么修改都无法起作用，郁闷ing！ 为此再网络上一搜再搜，总算黄天不负有心人，把问题给办了。&#60;%@ codepage=936%&#62;简体中文 &#60;%@ codepage=950%&#62;繁体中文 &#60;%@ codepage=65001%&#62;UTF-8 codepage指定了IIS按什么编码读取传递过来的串串（表单提交，地址栏传递等）。 出乱码的原因也就是网站要整合的时候模块编码不一样引起的。 最方便的方法如下： 不要转换任何模块网页的编码该utf-8的还是utf-8，该Gb22312的还是Gb2312 在Utf-8模块的包文件（如conn.asp，但是要注意conn.asp必须是在第一行调用）最前面加上 &#60;%@LANGUAGE=&#34;VBSCRIPT&#34; CODEPAGE=&#34;65001&#34;%&#62; &#60;%Session.CodePage=65001%&#62; 在GB2312模块的包文件最前面加上 &#60;%@LANGUAGE=&#34;VBSCRIPT&#34; CODEPAGE=&#34;936&#34;%&#62; &#60;%Session.CodePage=936%&#62; 相关博文2010年07月26日 -- 最令PHP初学者头痛的十四个问题 (0)2010年07月28日 -- ASP防注入新方式，希望对大家是有用的 (0)2010年05月23日 -- PHP封装常用Javascript为JS类以便快速调用 (1)2010年05月23日 -- mysql优化及全文搜索 (0)2008年10月17日 -- 网络游戏的对时以及同步问题 (0)2011年06月29日 -- 开源软件的盈利模式 (0)2010年07月28日 -- 完美解决“由于这台计算机没有终端服务器客户端访问许可证” (0)2010年07月28日 -- 帝国备份王(Empirebak)拿webshell (0)2010年07月26日 -- PHP和Socket简介 (0)2010年07月26日 -- php的文档句法(heredoc)]]></description>
			<content:encoded><![CDATA[<p><br/>最近在做网站的时候，遇到这么一个奇怪的问题，无法正确执行sql语句，response了一下，原来sql语句里面的中文字段都成了乱码，怀疑是编码的问题，但是怎么修改都无法起作用，郁闷ing！ <br/><br/>为此再网络上一搜再搜，总算黄天不负有心人，把问题给办了。<br/>&lt;%@ codepage=936%&gt;简体中文 <br/>&lt;%@ codepage=950%&gt;繁体中文 <br/>&lt;%@ codepage=65001%&gt;UTF-8 <br/><br/>codepage指定了IIS按什么编码读取传递过来的串串（表单提交，地址栏传递等）。 <br/><br/>出乱码的原因也就是网站要整合的时候模块编码不一样引起的。 <br/><br/>最方便的方法如下： <br/><br/>不要转换任何模块网页的编码该utf-8的还是utf-8，该Gb22312的还是Gb2312 <br/>在Utf-8模块的包文件（如conn.<a href="http://www.5bay.cn/tag/asp" class="st_tag internal_tag" rel="tag" title="标签 ASP 下的日志">asp</a>，但是要注意conn.asp必须是在第一行调用）最前面加上 <br/>&lt;%@LANGUAGE=&quot;VBSCRIPT&quot; CODEPAGE=&quot;65001&quot;%&gt; <br/>&lt;%Session.CodePage=65001%&gt; <br/><br/>在GB2312模块的包文件最前面加上 <br/>&lt;%@LANGUAGE=&quot;VBSCRIPT&quot; CODEPAGE=&quot;936&quot;%&gt; <br/>&lt;%Session.CodePage=936%&gt;<br/></p>
<h2  class="related_post_title">相关博文</h2><ul class="related_post"><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/eeeeeeee.html" title="最令PHP初学者头痛的十四个问题">最令PHP初学者头痛的十四个问题</a> (0)</li><li>2010年07月28日 -- <a href="http://www.5bay.cn/server-building/aspeaojie.html" title="ASP防注入新方式，希望对大家是有用的">ASP防注入新方式，希望对大家是有用的</a> (0)</li><li>2010年05月23日 -- <a href="http://www.5bay.cn/network-programming/phpfengzhuangchangyongjavascriptweijsleiyibiankuaisudiaoyong.html" title="PHP封装常用Javascript为JS类以便快速调用">PHP封装常用Javascript为JS类以便快速调用</a> (1)</li><li>2010年05月23日 -- <a href="http://www.5bay.cn/server-building/mysqlyouhuajiquanwensousuo.html" title="mysql优化及全文搜索">mysql优化及全文搜索</a> (0)</li><li>2008年10月17日 -- <a href="http://www.5bay.cn/game-development/%E7%BD%91%E7%BB%9C%E6%B8%B8%E6%88%8F%E7%9A%84%E5%AF%B9%E6%97%B6%E4%BB%A5%E5%8F%8A%E5%90%8C%E6%AD%A5%E9%97%AE%E9%A2%98.html" title="网络游戏的对时以及同步问题">网络游戏的对时以及同步问题</a> (0)</li><li>2011年06月29日 -- <a href="http://www.5bay.cn/me/kaiyuanruanjiandeyinglimoshi.html" title="开源软件的盈利模式">开源软件的盈利模式</a> (0)</li><li>2010年07月28日 -- <a href="http://www.5bay.cn/server-building/yaoeeechueeeeeeee.html" title="完美解决“由于这台计算机没有终端服务器客户端访问许可证”">完美解决“由于这台计算机没有终端服务器客户端访问许可证”</a> (0)</li><li>2010年07月28日 -- <a href="http://www.5bay.cn/server-building/aoeempirebakeebshell.html" title="帝国备份王(Empirebak)拿webshell">帝国备份王(Empirebak)拿webshell</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/phpeecketee.html" title="PHP和Socket简介">PHP和Socket简介</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/phpeefangeredoc.html" title="php的文档句法(heredoc)<<<和PHP字符串操作">php的文档句法(heredoc)<<<和PHP字符串操作</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/phpeeeeeeeehuai.html" title="PHP对文本数据库的基本操作方法">PHP对文本数据库的基本操作方法</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajax.html" title="AJAX的各种控件和类库">AJAX的各种控件和类库</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/eejaxeeeeee.html" title="使用Ajax时的十个常犯的错误">使用Ajax时的十个常犯的错误</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/eejaxeeetpit.html" title="了解Ajax中的Get和Post ">了解Ajax中的Get和Post </a> (0)</li><li>2010年05月23日 -- <a href="http://www.5bay.cn/server-building/rsyncxiangjie.html" title="Rsync详解">Rsync详解</a> (0)</li></ul>
	标签Tags：<a href="http://www.5bay.cn/category/network-programming/asp" title="ASP" rel="tag">ASP</a>, <a href="http://www.5bay.cn/tag/asp" title="ASP" rel="tag">ASP</a>, <a href="http://www.5bay.cn/tag/server" title="server" rel="tag">server</a>, <a href="http://www.5bay.cn/tag/sql" title="sql" rel="tag">sql</a>, <a href="http://www.5bay.cn/tag/%E5%87%BA%E7%8E%B0%E4%B9%B1%E7%A0%81" title="出现乱码" rel="tag">出现乱码</a>, <a href="http://www.5bay.cn/tag/%E6%95%B0%E6%8D%AE" title="数据" rel="tag">数据</a>, <a href="http://www.5bay.cn/tag/%E8%A7%A3%E5%86%B3%E6%96%B9%E6%B3%95" title="解决方法" rel="tag">解决方法</a><br />
]]></content:encoded>
			<wfw:commentRss>http://www.5bay.cn/network-programming/asp/asp%E8%AF%BBsqlserver%E6%95%B0%E6%8D%AE%E5%87%BA%E7%8E%B0%E4%B9%B1%E7%A0%81%E9%97%AE%E9%A2%98%E8%A7%A3%E5%86%B3%E6%96%B9%E6%B3%95.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ASP常用函数表（新手们的好工具）</title>
		<link>http://www.5bay.cn/network-programming/asp/asp%E5%B8%B8%E7%94%A8%E5%87%BD%E6%95%B0%E8%A1%A8%EF%BC%88%E6%96%B0%E6%89%8B%E4%BB%AC%E7%9A%84%E5%A5%BD%E5%B7%A5%E5%85%B7%EF%BC%89.html</link>
		<comments>http://www.5bay.cn/network-programming/asp/asp%E5%B8%B8%E7%94%A8%E5%87%BD%E6%95%B0%E8%A1%A8%EF%BC%88%E6%96%B0%E6%89%8B%E4%BB%AC%E7%9A%84%E5%A5%BD%E5%B7%A5%E5%85%B7%EF%BC%89.html#comments</comments>
		<pubDate>Fri, 09 Feb 2007 19:34:16 +0000</pubDate>
		<dc:creator>江小邪</dc:creator>
				<category><![CDATA[ASP]]></category>
		<category><![CDATA[工具]]></category>
		<category><![CDATA[常用函数]]></category>
		<category><![CDATA[新手]]></category>
		<category><![CDATA[表]]></category>

		<guid isPermaLink="false">?p=197</guid>
		<description><![CDATA[<a href="http://www.5bay.cn/network-programming/asp/asp%E5%B8%B8%E7%94%A8%E5%87%BD%E6%95%B0%E8%A1%A8%EF%BC%88%E6%96%B0%E6%89%8B%E4%BB%AC%E7%9A%84%E5%A5%BD%E5%B7%A5%E5%85%B7%EF%BC%89.html"><img align="left" hspace="5" width="150" height="150" src="http://www.5bay.cn/wp-content/plugins/thumbnail-for-excerpts/tfe_no_thumb.png" class="alignleft wp-post-image tfe" alt="" title="" /></a>Array() 函数返回一个数组 表达式 Array(list) 允许数据类型: 字符，数字均可 实例： &#60;%Dim myArray()For i = 1 to 7Redim Preserve myArray(i)myArray(i) = WeekdayName(i)Next%&#62; 返回结果: 建立了一个包含7个元素的数组myArraymyArray(&#34;Sunday&#34;,&#34;Monday&#34;, &#8230; &#8230; &#34;Saturday&#34;) CInt() 函数将一个表达式转化为数字类型 表达式 CInt(expression)允许数据类型: 任何有效的字符均可(不大于32767)实例： &#60;%f = &#34;234&#34;response.write cINT(f) + 2%&#62; 返回结果: 236转化字符&#34;234&#34;为数字&#34;234&#34;，如果字符串为空，则返回0值 CreateObject() 函数建立和返回一个已注册的ACTIVEX组件的实例。 表达式 CreateObject(objName) 允许数据类型: objName 是任何一个有效、已注册的ACTIVEX组件的名字. 实例： &#60;%Set con = Server.CreateObject(&#34;ADODB.Connection&#34;)%&#62; CStr() 函数转化一个表达式为字符串. 表达式 CStr(expression) 允许数据类型: expression 是任何有效的表达式。 [...]]]></description>
			<content:encoded><![CDATA[<p>Array() <br/>函数返回一个数组 <br/>表达式 Array(list) <br/>允许数据类型: 字符，数字均可 <br/>实例： &lt;%<br/>Dim myArray()<br/>For i = 1 to 7<br/>Redim Preserve myArray(i)<br/>myArray(i) = WeekdayName(i)<br/>Next<br/>%&gt; <br/>返回结果: 建立了一个包含7个元素的数组myArray<br/>myArray(&quot;Sunday&quot;,&quot;Monday&quot;, &#8230; &#8230; &quot;Saturday&quot;) <br/><br/>CInt() <br/>函数将一个表达式转化为数字类型 <br/>表达式 CInt(expression)<br/>允许数据类型: 任何有效的字符均可(不大于32767)<br/>实例： &lt;%<br/>f = &quot;234&quot;<br/>response.write cINT(f) + 2<br/>%&gt; <br/>返回结果: 236<br/>转化字符&quot;234&quot;为数字&quot;234&quot;，如果字符串为空，则返回0值 <br/><br/>CreateObject() <br/>函数建立和返回一个已注册的ACTIVEX组件的实例。 <br/>表达式 CreateObject(objName) <br/>允许数据类型: objName 是任何一个有效、已注册的ACTIVEX组件的名字. <br/>实例： &lt;%<br/>Set con = <a href="http://www.5bay.cn/tag/server" class="st_tag internal_tag" rel="tag" title="标签 server 下的日志">Server</a>.CreateObject(&quot;ADODB.Connection&quot;)<br/>%&gt; <br/><span id="more-197"></span><br/>CStr() <br/>函数转化一个表达式为字符串. <br/>表达式 CStr(expression) <br/>允许数据类型: expression 是任何有效的表达式。 <br/>实例： &lt;%<br/>s = 3 + 2<br/>response.write &quot;The 返回结果 is: &quot; &amp; cStr(s)<br/>%&gt; <br/>返回结果: 转化数字“5”为字符“5”。 <br/><br/>Date() <br/>函数返回当前系统日期. <br/>表达式 Date() <br/>允许数据类型: None. <br/>实例： &lt;%=Date%&gt; <br/>返回结果: 9/9/00 <br/><br/>DateAdd() <br/>函数返回一个被改变了的日期。 <br/>表达式 DateAdd(timeinterval,number,date) <br/>允许数据类型:<br/>timeinterval is the time interval to add; <br/>number is amount of time intervals to add; <br/>and date is the starting date. <br/>实例： &lt;%<br/>currentDate = #9/9/00#<br/>newDate = DateAdd(&quot;m&quot;,3,currentDate)<br/>response.write newDate<br/>%&gt;<br/>&lt;%<br/>currentDate = #12:34:45 PM#<br/>newDate = DateAdd(&quot;h&quot;,3,currentDate)<br/>response.write newDate<br/>%&gt; <br/>返回结果: 9/9/00<br/>3:34:45 PM<br/>&quot;m&quot; = &quot;month&quot;;<br/>&quot;d&quot; = &quot;day&quot;;<br/>If currentDate is in time format then,<br/>&quot;h&quot; = &quot;hour&quot;; <br/>&quot;s&quot; = &quot;second&quot;; <br/><br/>DateDiff() <br/>函数返回两个日期之间的差值 。 <br/>表达式 DateDiff(timeinterval,date1,date2 [, firstdayofweek [, firstweekofyear]]) <br/>允许数据类型: timeinterval 表示相隔时间的类型，如“M“表示“月”。 <br/>实例： &lt;%<br/>fromDate = #9/9/00#<br/>toDate = #1/1/2000#<br/>response.write &quot;There are &quot; &amp; _<br/>DateDiff(&quot;d&quot;,fromDate,toDate) &amp; _<br/>&quot; days to millenium from 9/9/00.&quot;<br/>%&gt; <br/>返回结果: 从9/9/00 到2000年还有 150 天. <br/><br/>Day() <br/>函数返回一个月的第几日 . <br/>表达式 Day(date) <br/>允许数据类型: date 是任何有效的日期。 <br/>实例： &lt;%=Day(#9/9/00#)%&gt; <br/>返回结果: 9 <br/><br/>formatCurrency() <br/>函数返回表达式，此表达式已被格式化为货币值 <br/>表达式 formatCurrency(Expression [, Digit [, LeadingDigit [, Paren [, GroupDigit]]]]) <br/>允许数据类型: Digit 指示小数点右侧显示位数的数值。默认值为 -1，指示使用的是计算机的区域设置; LeadingDigit 三态常数，指示是否显示小数值小数点前面的零。 <br/>实例： &lt;%=formatCurrency(34.3456)%&gt; <br/>返回结果: $34.35 <br/><br/>formatDateTime() <br/>函数返回表达式，此表达式已被格式化为日期或时间 <br/>表达式 formatDateTime(Date, [, Namedformat]) <br/>允许数据类型: Namedformat 指示所使用的日期/时间格式的数值，如果省略，则使用 vbGeneralDate. <br/>实例： &lt;%=formatDateTime(&quot;09/9/00&quot;, vbLongDate)%&gt; <br/>返回结果: Sunday, September 09, 2000<br/><br/>formatNumber() <br/>函数返回表达式，此表达式已被格式化为数值. <br/>表达式 formatNumber(Expression [, Digit [, LeadingDigit [, Paren [, GroupDigit]]]]) <br/>允许数据类型: Digit 指示小数点右侧显示位数的数值。默认值为 -1，指示使用的是计算机的区域设置。; LeadingDigit i指示小数点右侧显示位数的数值。默认值为 -1，指示使用的是计算机的区域设置。; Paren 指示小数点右侧显示位数的数值。默认值为 -1，指示使用的是计算机的区域设置。; GroupDigit i指示小数点右侧显示位数的数值。默认值为 -1，指示使用的是计算机的区域设置。. [Page]<br/>实例： &lt;%=formatNumber(45.324567, 3)%&gt; <br/>返回结果: 45.325 <br/><br/>formatPercent() <br/>函数返回表达式，此表达式已被格式化为尾随有 % 符号的百分比（乘以 100 ）。 (%) <br/>表达式 formatPercent(Expression [, Digit [, LeadingDigit [, Paren [, GroupDigit]]]]) <br/>允许数据类型: 同上. <br/>实例： &lt;%=formatPercent(0.45267, 3)%&gt; <br/>返回结果: 45.267% <br/><br/>Hour() <br/>函数以24时返回小时数. <br/>表达式 Hour(time) <br/>允许数据类型: <br/>实例： &lt;%=Hour(#4:45:34 PM#)%&gt; <br/>返回结果: 16<br/>(Hour has been converted to 24-hour system) <br/><br/>Instr() <br/>函数返回字符或字符串在另一个字符串中第一次出现的位置. <br/>表达式 Instr([start, ] strToBeSearched, strSearchFor [, compare]) <br/>允许数据类型: Start为搜索的起始值，strToBeSearched接受搜索的字符串 strSearchFor要搜索的字符.compare比较方式（详细见ASP常数） <br/>实例： &lt;%<br/>strText = &quot;This is a test!!&quot;<br/>pos = Instr(strText, &quot;a&quot;)<br/>response.write pos<br/>%&gt; <br/>返回结果: 9 <br/><br/>InstrRev() <br/>函数同上，只是从字符串的最后一个搜索起 <br/>表达式 InstrRev([start, ] strToBeSearched, strSearchFor [, compare]) <br/>允许数据类型: 同上. <br/>实例： &lt;%<br/>strText = &quot;This is a test!!&quot;<br/>pos = InstrRev(strText, &quot;s&quot;)<br/>response.write pos<br/>%&gt; <br/>返回结果: 13<br/><br/>Int() <br/>函数返回数值类型,不四舍五入。 <br/>表达式 Int(number) <br/>允许数据类型: <br/>实例： &lt;%=INT(32.89)%&gt; <br/>返回结果: 32 <br/><br/>IsArray() <br/>函数判断一对象是否为数组，返回布尔值 . <br/>表达式 IsArray(name) <br/>实例： &lt;%<br/>strTest = &quot;Test!&quot;<br/>response.write IsArray(strTest)<br/>%&gt; <br/>返回结果: False <br/><br/>IsDate() <br/>函数判断一对象是否为日期，返回布尔值 <br/>表达式 IsDate(expression) <br/>实例： &lt;%<br/>strTest = &quot;9/4/2000&quot;<br/>response.write IsDate(strTest)<br/>%&gt; <br/>返回结果: True <br/><br/>IsEmpty() <br/>函数判断一对象是否初始化，返回布尔值. <br/>表达式 IsEmpty(expression) <br/>实例： &lt;%<br/>Dim i<br/>response.write IsEmpty(i)<br/>%&gt; <br/>返回结果: True <br/><br/>IsNull() <br/>函数判断一对象是否为空，返回布尔值. <br/>表达式 IsNull(expression) <br/>实例： &lt;%<br/>Dim i<br/>response.write IsNull(i)<br/>%&gt; <br/>返回结果: False <br/><br/>IsNumeric() <br/>函数判断一对象是否为数字，返回布尔值. <br/>表达式 IsNumeric(expression) <br/>实例： &lt;%<br/>i = &quot;345&quot;<br/>response.write IsNumeric(i)<br/>%&gt; <br/>返回结果: True<br/>就算数字加了引号，ASP还是认为它是数字。 <br/><br/>IsObject() <br/>函数判断一对象是否为对象，返回布尔值. <br/>表达式 IsObject(expression) <br/>实例： &lt;%<br/>Set con = Server.CreateObject(&quot;ADODB.Connection&quot;)<br/>response.write IsObject(con)<br/>%&gt; <br/>返回结果: True <br/><br/>LBound() <br/>函数返回指定数组维的最小可用下标. <br/>表达式 Lbound(arrayname [, dimension]) <br/>实例： &lt;%<br/>i = Array(&quot;Monday&quot;,&quot;Tuesday&quot;,&quot;Wednesday&quot;)<br/>response.write LBound(i)<br/>%&gt; <br/>返回结果: 0 <br/><br/>LCase() <br/><a href="http://www.5bay.cn/tag/%E5%87%BD%E6%95%B0" class="st_tag internal_tag" rel="tag" title="标签 函数 下的日志">函数</a> 返回字符串的小写形式 <br/>表达式 Lcase(string) <br/>实例： &lt;%<br/>strTest = &quot;This is a test!&quot;<br/>response.write LCase(strTest)<br/>%&gt; <br/>返回结果: this is a test! <br/><br/>Left() <br/>函数返回字符串左边第length个字符以前的字符（含第length个字符). <br/>表达式 Left(string, length) <br/>实例： &lt;%<br/>strTest = &quot;This is a test!&quot;<br/>response.write Left(strTest, 3)<br/>%&gt; <br/>返回结果: Thi <br/><br/>Len() <br/>函数返回字符串的长度. <br/>表达式 Len(string &#124; varName) <br/>实例： &lt;%<br/>strTest = &quot;This is a test!&quot;<br/>response.write Len(strTest)<br/>%&gt; <br/>返回结果: 15 <br/><br/>LTrim() <br/>函数去掉字符串左边的空格. <br/>表达式 LTrim(string) <br/>实例： &lt;%<br/>strTest = &quot; This is a test!&quot;<br/>response.write LTrim(strTest)<br/>%&gt; <br/>返回结果: This is a test! <br/><br/>Mid() <br/>函数返回特定长度的字符串(从start开始,长度为length). [Page]<br/>表达式 Mid(string, start [, length]) <br/>实例： &lt;%<br/>strTest = &quot;This is a test! Today is Monday.&quot;<br/>response.write Mid(strTest, 17, 5)<br/>%&gt; <br/>返回结果: Today <br/><br/>Minute() <br/>函数返回时间的分钟. <br/>表达式 Minute(time) <br/>实例： &lt;%=Minute(#12:45:32 PM#)%&gt; <br/>返回结果: 45 <br/><br/>Month() <br/>函数返回日期. <br/>表达式 Month(date) <br/>实例： &lt;%=Month(#08/04/99#)%&gt; <br/>返回结果: 8 <br/><br/>MonthName() <br/>函数返回指定月份<br/>表达式 MonthName(month, [, Abb]) <br/>实例： &lt;%=MonthName(Month(#08/04/99#))%&gt; <br/>返回结果: August <br/><br/>Now() <br/>函数返回系统时间 <br/>表达式 Now() <br/>实例： &lt;%=Now%&gt; <br/>返回结果: 9/9/00 9:30:16 AM <br/><br/>Right() <br/>函数返回字符串右边第length个字符以前的字符（含第length个字符). <br/>表达式 Right(string, length) <br/>实例： &lt;% <br/>strTest = &quot;This is an test!&quot;<br/>response.write Right(strTest, 3)<br/>%&gt; <br/>返回结果: st! <br/><br/>Rnd() <br/>函数产生一个随机数. <br/>表达式 Rnd [ (number) ] <br/>实例： &lt;%<br/>Randomize()<br/>response.write RND()<br/>%&gt; <br/>返回结果: 任何一个在0 到 1 之间的数 <br/><br/>Round() <br/>函数返回按指定位数进行四舍五入的数值. <br/>表达式 Round(expression [, numRight]) <br/>实例： &lt;%<br/>i = 32.45678<br/>response.write Round(i)<br/>%&gt; <br/>返回结果: 32 <br/><br/>Rtrim() <br/>函数去掉字符串右边的字符串. <br/>表达式 Rtrim(string) <br/>实例： &lt;%<br/>strTest = &quot;This is a test!! &quot;<br/>response.write RTrim(strTest)<br/>%&gt; <br/>返回结果: This is a test!! <br/><br/>Split()<br/>函数将一个字符串分割并返回分割结果<br/>表达式 Split (S[，d]) <br/>实例：&lt;%V= Split(A,B,C)<br/>For i = 0 To UBound(V)<br/>Response.Write V(i)<br/>Next<br/>%&gt;<br/>返回结果: A B C<br/><br/>Second() <br/>函数返回秒. <br/>表达式 Second(time) <br/>实例： &lt;%=Second(#12:34:28 PM#)%&gt; <br/>返回结果: 28 <br/><br/>StrReverse() <br/>函数反排一字符串 <br/>表达式 StrReverse(string) <br/>实例： &lt;%<br/>strTest = &quot;This is a test!!&quot;<br/>response.write StrReverse(strTest)<br/>%&gt; <br/>返回结果: !!tset a si sihT <br/><br/>Time() <br/>函数返回系统时间. <br/>表达式 Time() <br/>实例： &lt;%=Time%&gt; <br/>返回结果: 9:58:28 AM <br/><br/>Trim() <br/>函数去掉字符串左右的空格. <br/>表达式 Trim(string) <br/>实例： &lt;%<br/>strTest = &quot; This is a test!! &quot;<br/>response.write Trim(strTest)<br/>%&gt; <br/>返回结果: This is a test!! <br/><br/>UBound() <br/>函数返回指定数组维数的最大可用下标&gt;. <br/>表达式 Ubound(arrayname [, dimension]) <br/>实例： &lt;%<br/>i = Array(&quot;Monday&quot;,&quot;Tuesday&quot;,&quot;Wednesday&quot;)<br/>response.write UBound(i)<br/>%&gt; <br/>返回结果: 2 <br/><br/>UCase() <br/>函数返回字符串的大写形式. <br/>表达式 UCase(string) <br/>允许数据类型: <br/>实例： &lt;%<br/>strTest = &quot;This is a test!!&quot;<br/>response.write UCase(strTest)<br/>%&gt; <br/>返回结果: THIS IS A TEST!! <br/><br/>VarType() <br/>函数返回指示变量子类型的值 <br/>表达式 VarType(varName) <br/>实例： &lt;%<br/>i = 3<br/>response.write varType(i)<br/>%&gt; <br/>返回结果: 2(数字)详见&quot;asp常数&quot; <br/><br/>WeekDay() <br/>函数返回在一周的第几天. <br/>表达式 WeekDay(date [, firstdayofweek]) <br/>实例： &lt;%<br/>d = #9/9/00#<br/>response.write Weekday(d)<br/>%&gt; <br/>返回结果: 4(星期三) <br/><br/>WeekDayName() <br/>函数返回一周第几天的名字. <br/>表达式 WeekDayName(weekday [, Abb [, firstdayofweek]]) <br/>实例： &lt;%<br/>d = #9/9/00#<br/>response.write WeekdayName(Weekday(d))<br/>%&gt; <br/>返回结果: Wednesday <br/><br/>Year() <br/>函数返回当前的年份. <br/>表达式 Year(date) <br/>实例： &lt;%=Year(#9/9/00#)%&gt; <br/>返回结果: 1999 <br/><br/></p>
<h2  class="related_post_title">相关博文</h2><ul class="related_post"><li>2011年06月29日 -- <a href="http://www.5bay.cn/me/kaiyuanruanjiandeyinglimoshi.html" title="开源软件的盈利模式">开源软件的盈利模式</a> (0)</li><li>2011年06月29日 -- <a href="http://www.5bay.cn/game-development/zishenshejishitonyventricejiexishoujiyouxikaifadesigecengci.html" title="资深设计师Tony Ventrice解析手机游戏开发的四个层次">资深设计师Tony Ventrice解析手机游戏开发的四个层次</a> (0)</li><li>2010年07月28日 -- <a href="http://www.5bay.cn/server-building/aspeaojie.html" title="ASP防注入新方式，希望对大家是有用的">ASP防注入新方式，希望对大家是有用的</a> (0)</li><li>2010年07月28日 -- <a href="http://www.5bay.cn/server-building/eeprn-asp-jpg.html" title="如何删除删不掉的”PRN.asp:.jpg”">如何删除删不掉的”PRN.asp:.jpg”</a> (0)</li><li>2010年05月23日 -- <a href="http://www.5bay.cn/server-building/rsyncxiangjie.html" title="Rsync详解">Rsync详解</a> (0)</li><li>2008年10月17日 -- <a href="http://www.5bay.cn/game-development/%E6%B8%B8%E6%88%8F%E6%95%B0%E5%80%BC%E5%85%AC%E5%BC%8F%E7%9A%84%E8%A1%A8%E8%B1%A1%E4%B8%8E%E6%9C%AC%E8%B4%A8.html" title="游戏数值公式的表象与本质">游戏数值公式的表象与本质</a> (0)</li><li>2011年06月29日 -- <a href="http://www.5bay.cn/android%e7%ac%94%e8%ae%b0/androidzaixiankaifagongjuappinventor.html" title="Android在线开发工具 App Inventor">Android在线开发工具 App Inventor</a> (0)</li><li>2010年07月28日 -- <a href="http://www.5bay.cn/server-building/yaoeeechueeeeeeee.html" title="完美解决“由于这台计算机没有终端服务器客户端访问许可证”">完美解决“由于这台计算机没有终端服务器客户端访问许可证”</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajaxeeaoe.html" title="AJAX应用程序开发七宗罪">AJAX应用程序开发七宗罪</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajax.html" title="AJAX的各种控件和类库">AJAX的各种控件和类库</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/eejaxeeetpit.html" title="了解Ajax中的Get和Post ">了解Ajax中的Get和Post </a> (0)</li><li>2010年05月23日 -- <a href="http://www.5bay.cn/network-programming/phpfengzhuangchangyongjavascriptweijsleiyibiankuaisudiaoyong.html" title="PHP封装常用Javascript为JS类以便快速调用">PHP封装常用Javascript为JS类以便快速调用</a> (1)</li><li>2010年05月23日 -- <a href="http://www.5bay.cn/server-building/mysqlyouhuajiquanwensousuo.html" title="mysql优化及全文搜索">mysql优化及全文搜索</a> (0)</li><li>2010年05月23日 -- <a href="http://www.5bay.cn/server-building/eacceleratoryumemcachedequbieyuyongtu.html" title="eAccelerator与memcache的区别与用途">eAccelerator与memcache的区别与用途</a> (2)</li><li>2010年05月23日 -- <a href="http://www.5bay.cn/server-building/nginxderewriteguize.html" title="nginx的rewrite规则">nginx的rewrite规则</a> (1)</li></ul>
	标签Tags：<a href="http://www.5bay.cn/category/network-programming/asp" title="ASP" rel="tag">ASP</a>, <a href="http://www.5bay.cn/tag/asp" title="ASP" rel="tag">ASP</a>, <a href="http://www.5bay.cn/tag/%E5%B7%A5%E5%85%B7" title="工具" rel="tag">工具</a>, <a href="http://www.5bay.cn/tag/%E5%B8%B8%E7%94%A8%E5%87%BD%E6%95%B0" title="常用函数" rel="tag">常用函数</a>, <a href="http://www.5bay.cn/tag/%E6%96%B0%E6%89%8B" title="新手" rel="tag">新手</a>, <a href="http://www.5bay.cn/tag/%E8%A1%A8" title="表" rel="tag">表</a><br />
]]></content:encoded>
			<wfw:commentRss>http://www.5bay.cn/network-programming/asp/asp%E5%B8%B8%E7%94%A8%E5%87%BD%E6%95%B0%E8%A1%A8%EF%BC%88%E6%96%B0%E6%89%8B%E4%BB%AC%E7%9A%84%E5%A5%BD%E5%B7%A5%E5%85%B7%EF%BC%89.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>多字段模糊搜索函数</title>
		<link>http://www.5bay.cn/network-programming/asp/%E5%A4%9A%E5%AD%97%E6%AE%B5%E6%A8%A1%E7%B3%8A%E6%90%9C%E7%B4%A2%E5%87%BD%E6%95%B0.html</link>
		<comments>http://www.5bay.cn/network-programming/asp/%E5%A4%9A%E5%AD%97%E6%AE%B5%E6%A8%A1%E7%B3%8A%E6%90%9C%E7%B4%A2%E5%87%BD%E6%95%B0.html#comments</comments>
		<pubDate>Wed, 27 Dec 2006 22:20:42 +0000</pubDate>
		<dc:creator>江小邪</dc:creator>
				<category><![CDATA[ASP]]></category>
		<category><![CDATA[函数]]></category>
		<category><![CDATA[多字段]]></category>
		<category><![CDATA[模糊搜索]]></category>

		<guid isPermaLink="false">?p=162</guid>
		<description><![CDATA[<a href="http://www.5bay.cn/network-programming/asp/%E5%A4%9A%E5%AD%97%E6%AE%B5%E6%A8%A1%E7%B3%8A%E6%90%9C%E7%B4%A2%E5%87%BD%E6%95%B0.html"><img align="left" hspace="5" width="150" height="150" src="http://www.5bay.cn/wp-content/plugins/thumbnail-for-excerpts/tfe_no_thumb.png" class="alignleft wp-post-image tfe" alt="" title="" /></a>前段时间写了一个多字段模糊搜索的函数（类似baidui）。函数代码如下&#039;==========================================&#039;函数名：keyword_sousuo&#039;作 用：生成sql查询条件&#039;参 数：table_field &#8212;&#8212; 表的字段名（之间用逗号分开）&#039; keyword &#8212;&#8212; 搜索关键词（之间用空格分开）&#039;返 回：sql查询条件&#039;==========================================function keyword_sousuo(byval table_field,byval keyword) dim str01,str02,keywords,table_fields,i,j &#160; &#160; &#160;table_fields=split(trim(table_field),&#34;,&#34;) &#160;keywords=split(trim(keyword),&#34;,&#34;) &#160; &#160;if table_field&#60;&#62;&#34;&#34; then &#160; str01=&#34;(&#34;&#38;table_fields(0)&#38;&#34; like &#039;%&#34;&#38;keyword&#38;&#34;%&#039;&#34; &#160; for j=0 to ubound(table_fields) &#160; str01=str01&#38;&#34; or &#34;&#38;table_fields(j)&#38;&#34; like &#039;%&#34;&#38;keyword&#38;&#34;%&#039;&#34; &#160; next &#160; str01=str01&#38;&#34;)&#34; &#160;else &#160; response.Write(&#34;&#60;script&#62;alert(&#039;参数错误（不能为空）！&#039;)&#60;/script&#62;&#34;) &#160; response.End() &#160;end if &#039;全角－－》半角　空格 &#039;keyword=replace(keyword,&#34;　&#34;,&#34; &#34;) &#039;while InStr(keyword,&#34; &#34;)&#62;0 &#039; [...]]]></description>
			<content:encoded><![CDATA[<p>前段时间写了一个多字段模糊搜索的函数（类似baidui）。函数代码如下<br/>&#039;==========================================<br/>&#039;函数名：keyword_sousuo<br/>&#039;作 用：生成sql查询条件<br/>&#039;参 数：table_field &#8212;&#8212; 表的字段名（之间用逗号分开）<br/>&#039; keyword &#8212;&#8212; 搜索关键词（之间用空格分开）<br/>&#039;返 回：sql查询条件<br/>&#039;==========================================<span id="more-162"></span><br/>function keyword_sousuo(byval table_field,byval keyword)<br/> dim str01,str02,keywords,table_fields,i,j<br/> &nbsp; &nbsp;<br/> &nbsp;table_fields=split(trim(table_field),&quot;,&quot;)<br/> &nbsp;keywords=split(trim(keyword),&quot;,&quot;)<br/> &nbsp;<br/> &nbsp;if table_field&lt;&gt;&quot;&quot; then<br/> &nbsp; str01=&quot;(&quot;&amp;table_fields(0)&amp;&quot; like &#039;%&quot;&amp;keyword&amp;&quot;%&#039;&quot;<br/> &nbsp; for j=0 to ubound(table_fields)<br/> &nbsp; str01=str01&amp;&quot; or &quot;&amp;table_fields(j)&amp;&quot; like &#039;%&quot;&amp;keyword&amp;&quot;%&#039;&quot;<br/> &nbsp; next<br/> &nbsp; str01=str01&amp;&quot;)&quot;<br/> &nbsp;else<br/> &nbsp; response.Write(&quot;&lt;script&gt;alert(&#039;参数错误（不能为空）！&#039;)&lt;/script&gt;&quot;)<br/> &nbsp; response.End()<br/> &nbsp;end if<br/><br/> &#039;全角－－》半角　空格<br/> &#039;keyword=replace(keyword,&quot;　&quot;,&quot; &quot;)<br/> &#039;while InStr(keyword,&quot; &quot;)&gt;0<br/> &#039; keyword=replace(keyword,&quot; &quot;,&quot; &quot;)<br/> &#039;wend<br/> keywords=split(keyword,&quot; &quot;)<br/> if ubound(keywords)&gt;0 then<br/> for i=0 to ubound(keywords)<br/> &nbsp; str02=str02&amp;&quot;(&quot;&amp;table_fields(0)&amp;&quot; like &#039;%&quot;&amp;keywords(i)&amp;&quot;%&#039;&quot;<br/> &nbsp; for j=1 to ubound(table_fields)<br/> &nbsp; str02=str02&amp;&quot; or &quot;&amp;table_fields(j)&amp;&quot; like &#039;%&quot;&amp;keywords(i)&amp;&quot;%&#039;&quot;<br/> &nbsp; next<br/> &nbsp; str02=str02&amp;&quot;)&quot;<br/> next<br/> str02=&quot;(&quot;&amp;replace(str02,&quot;)(&quot;,&quot;)and(&quot;)&amp;&quot;)&quot;<br/> keyword_sousuo=&quot;(&quot; &amp; str01 &amp; &quot;or&quot; &amp; str02 &amp; &quot;)&quot;<br/> else<br/> keyword_sousuo=str01<br/> end if<br/>end function<br/>&#039;==================================================<br/>&#039;函数名：keyword_tag<br/>&#039;作 用：将字符串里的关键词标记为红色<br/>&#039;参 数：str &#8212;&#8212; 字符串<br/>&#039; keyword &#8212;&#8212; 标记关键词（之间用空格分开）<br/>&#039;返 回：字符串（html格式）<br/>&#039;==================================================<br/>function keyword_tag(byval str,byval keyword)<br/> dim keywords,str01,str02,i<br/> &nbsp; &#039;全角－－》半角　空格<br/> &#039;keyword=replace(keyword,&quot;　&quot;,&quot; &quot;)<br/> &#039;while InStr(keyword,&quot; &quot;)&gt;0<br/> &#039; keyword=replace(keyword,&quot; &quot;,&quot; &quot;)<br/> &#039;wend<br/> str01=replace(str,keyword,&quot;&lt;font color=&quot;&quot;#ff0000&quot;&quot;&gt;&quot;&amp;keyword&amp;&quot;&lt;/font&gt;&quot;) <br/> &nbsp; keywords=split(keyword,&quot; &quot;)<br/> if ubound(keywords)&gt;0 then<br/> &nbsp; str02=str<br/> for i=0 to ubound(keywords)<br/> str02=replace(str02,keywords(i),&quot;&lt;font color=&quot;&quot;#ff0000&quot;&quot;&gt;&quot;&amp;keywords(i)&amp;&quot;&lt;/font&gt;&quot;) <br/> next<br/> &nbsp; keyword_tag=str02<br/> else<br/> keyword_tag=str01<br/> end if<br/>end function<br/><br/>一个使用的例子：recordread.<a href="http://www.5bay.cn/tag/asp" class="st_tag internal_tag" rel="tag" title="标签 ASP 下的日志">asp</a><br/><br/>&lt;%@LANGUAGE=&quot;VBSCRIPT&quot; CODEPAGE=&quot;936&quot;%&gt;<br/>&lt;%<br/> option explicit<br/> dim conn,connstr,database<br/> connstr=&quot;DBQ=&quot;+server.mappath(&quot;record.mdb&quot;)+&quot;;DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};&quot;<br/> set conn=server.CreateObject(&quot;adodb.connection&quot;)<br/> conn.open connstr<br/><br/>dim n,rs,page,keyword,keywords,RecordCount,pageCount,pos,i,<a href="http://www.5bay.cn/tag/sql" class="st_tag internal_tag" rel="tag" title="标签 sql 下的日志">sql</a>_where<br/>n=50<br/>page=Request(&quot;page&quot;)<br/>keyword=trim(request(&quot;keyword&quot;))<br/>sql_where=keyword_sousuo(&quot;title,cz,name,time&quot;,keyword)<br/>set rs=server.CreateObject(&quot;adodb.recordset&quot;)<br/>rs.open &quot;select * from record where &quot;&amp;sql_where&amp;&quot; order by id desc&quot;,conn,1,2<br/>if page=0 then<br/> page=1<br/> end if<br/>RecordCount = 0 <br/>do while not rs.Eof<br/> RecordCount = RecordCount +1<br/> rs.MoveNext <br/>loop<br/>if not RecordCount=0 then<br/> rs.MoveFirst<br/>end if<br/>pageCount=RecordCount/n<br/>pageCount=int(pageCount)<br/>if (RecordCount mod n)&gt;0 then<br/> PageCount=PageCount +1<br/>end if <br/>%&gt;<br/>&lt;style type=&quot;text/<a href="http://www.5bay.cn/tag/css" class="st_tag internal_tag" rel="tag" title="标签 css 下的日志">css</a>&quot;&gt;<br/>&lt;!&#8211;<br/>.STYLE3 {color: #666666}<br/>&#8211;&gt;<br/>&lt;/style&gt;<br/>&lt;table width=&quot;100%&quot; border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot;&gt;<br/> &lt;form id=&quot;form1&quot; name=&quot;form1&quot; method=&quot;post&quot; action=&quot;?&quot;&gt;&lt;tr&gt;&lt;td align=&quot;center&quot;&gt;&lt;input name=&quot;keyword&quot; type=&quot;text&quot; id=&quot;keyword&quot; value=&quot;&lt;%=keyword%&gt;&quot; size=&quot;30&quot; /&gt;<br/> &amp;nbsp; &lt;input type=&quot;submit&quot; name=&quot;Submit&quot; value=&quot;搜索&quot; /&gt;<br/> &lt;span class=&quot;STYLE3&quot;&gt;(关键词之间用空格分开) &lt;/span&gt;&lt;/td&gt;<br/> <br/> &lt;/tr&gt;&lt;/form&gt;<br/> &lt;tr&gt;<br/> &lt;td height=&quot;5&quot;&gt;&lt;/td&gt; <br/>&lt;/table&gt;<br/><br/>&lt;table width=&quot;600&quot; border=&quot;1&quot; align=&quot;center&quot; cellpadding=&quot;4&quot;&gt;<br/> &lt;tr align=&quot;center&quot;&gt; <br/> &lt;td width=&quot;131&quot;&gt;标题&lt;/td&gt;<br/> &lt;td width=&quot;131&quot;&gt;动作&lt;/td&gt;<br/> &lt;td width=&quot;131&quot;&gt;用户名&lt;/td&gt;<br/> &lt;td width=&quot;132&quot;&gt;时间&lt;/td&gt;<br/> &lt;/tr&gt;<br/>&lt;%pos=0<br/>do while pos&lt;(page-1)*n <br/>pos=pos+1 <br/>rs.moveNext <br/>loop<br/>i=0<br/>while not rs.eof and i&lt;n<br/>i=i+1%&gt;<br/> &lt;tr align=&quot;center&quot;&gt; <br/> &lt;td&gt;&lt;%=keyword_tag(rs(&quot;title&quot;),keyword)%&gt;&lt;/td&gt;<br/> &lt;td&gt;&lt;%=keyword_tag(rs(&quot;cz&quot;),keyword)%&gt;&lt;/td&gt;<br/> &lt;td&gt;&lt;%=keyword_tag(rs(&quot;name&quot;),keyword)%&gt;&lt;/td&gt;<br/> &lt;td&gt;&lt;%=keyword_tag(rs(&quot;time&quot;),keyword)%&gt;&lt;/td&gt;<br/> &lt;/tr&gt;<br/> <br/> &lt;%rs.movenext<br/> wend<br/> rs.close<br/> set rs=nothing<br/> conn.close<br/> set conn=nothing<br/> <br/>&#039;==================================================<br/>&#039;函数名：keyword_sousuo<br/>&#039;作 用：生成sql查询条件<br/>&#039;参 数：table_field &#8212;&#8212; 表的字段名（之间用逗号分开）<br/>&#039; keyword &#8212;&#8212; 搜索关键词（之间用空格分开）<br/>&#039;返 回：sql查询条件<br/>&#039;==================================================<br/>function keyword_sousuo(byval table_field,byval keyword)<br/> dim str01,str02,keywords,table_fields,i,j<br/> &nbsp; &nbsp;<br/> &nbsp;table_fields=split(trim(table_field),&quot;,&quot;)<br/> &nbsp;keywords=split(trim(keyword),&quot;,&quot;)<br/> &nbsp;<br/> &nbsp;if table_field&lt;&gt;&quot;&quot; then<br/> &nbsp; str01=&quot;(&quot;&amp;table_fields(0)&amp;&quot; like &#039;%&quot;&amp;keyword&amp;&quot;%&#039;&quot;<br/> &nbsp; for j=0 to ubound(table_fields)<br/> &nbsp; str01=str01&amp;&quot; or &quot;&amp;table_fields(j)&amp;&quot; like &#039;%&quot;&amp;keyword&amp;&quot;%&#039;&quot;<br/> &nbsp; next<br/> &nbsp; str01=str01&amp;&quot;)&quot;<br/> &nbsp;else<br/> &nbsp; response.Write(&quot;&lt;script&gt;alert(&#039;参数错误（不能为空）！&#039;)&lt;/script&gt;&quot;)<br/> &nbsp; response.End()<br/> &nbsp;end if<br/><br/> &#039;全角－－》半角　空格<br/> keyword=replace(keyword,&quot;　&quot;,&quot; &quot;)<br/> &#039; while InStr(keyword,&quot; &quot;)&gt;0<br/> &#039; keyword=replace(keyword,&quot; &quot;,&quot; &quot;)<br/> &#039;wend<br/> keywords=split(keyword,&quot; &quot;)<br/> if ubound(keywords)&gt;0 then<br/> for i=0 to ubound(keywords)<br/> &nbsp; str02=str02&amp;&quot;(&quot;&amp;table_fields(0)&amp;&quot; like &#039;%&quot;&amp;keywords(i)&amp;&quot;%&#039;&quot;<br/> &nbsp; for j=1 to ubound(table_fields)<br/> &nbsp; str02=str02&amp;&quot; or &quot;&amp;table_fields(j)&amp;&quot; like &#039;%&quot;&amp;keywords(i)&amp;&quot;%&#039;&quot;<br/> &nbsp; next<br/> &nbsp; str02=str02&amp;&quot;)&quot;<br/> next<br/> str02=&quot;(&quot;&amp;replace(str02,&quot;)(&quot;,&quot;)and(&quot;)&amp;&quot;)&quot;<br/> keyword_sousuo=&quot;(&quot; &amp; str01 &amp; &quot;or&quot; &amp; str02 &amp; &quot;)&quot;<br/> else<br/> keyword_sousuo=str01<br/> end if<br/>end function<br/>&#039;==================================================<br/>&#039;函数名：keyword_tag<br/>&#039;作 用：将字符串里的关键词标记为红色<br/>&#039;参 数：str &#8212;&#8212; 字符串<br/>&#039; keyword &#8212;&#8212; 标记关键词（之间用空格分开）<br/>&#039;返 回：字符串（html格式）<br/>&#039;==================================================<br/>function keyword_tag(byval str,byval keyword)<br/> dim keywords,str01,str02,i<br/> &nbsp; &#039;全角－－》半角　空格<br/> keyword=replace(keyword,&quot;　&quot;,&quot; &quot;)<br/> &#039;while InStr(keyword,&quot; &quot;)&gt;0<br/> &#039; keyword=replace(keyword,&quot; &quot;,&quot; &quot;)<br/> &#039;wend<br/> str01=replace(str,keyword,&quot;&lt;font color=&quot;&quot;#ff0000&quot;&quot;&gt;&quot;&amp;keyword&amp;&quot;&lt;/font&gt;&quot;) <br/> &nbsp; keywords=split(keyword,&quot; &quot;)<br/> if ubound(keywords)&gt;0 then<br/> &nbsp; str02=str<br/> for i=0 to ubound(keywords)<br/> str02=replace(str02,keywords(i),&quot;&lt;font color=&quot;&quot;#ff0000&quot;&quot;&gt;&quot;&amp;keywords(i)&amp;&quot;&lt;/font&gt;&quot;) <br/> next<br/> &nbsp; keyword_tag=str02<br/> else<br/> keyword_tag=str01<br/> end if<br/>end function<br/>dim y<br/>%&gt; &lt;tr align=&quot;center&quot;&gt; <br/> &lt;td colspan=&quot;4&quot;&gt; &lt;%=RecordCount%&gt;个&amp;nbsp; &lt;font color=&quot;#FF0000&quot;&gt;&lt;%=page%&gt;&lt;/font&gt;/&lt;%=pageCount%&gt;页 <br/> &amp;nbsp;&lt;%=n%&gt;个/页 转到： <br/> &lt;SELECT name=&quot;select&quot; onchange=window.open(this.options[selectedIndex].value,&#039;_self&#039;) &gt;<br/> &lt;%y=1<br/> &nbsp; &nbsp; &nbsp; &nbsp; do while y&lt;pagecount+1%&gt;<br/> &lt;OPTION value=?page=&lt;%=y%&gt;&amp;keyword=&lt;%=server.URLEncode(keyword)%&gt; &lt;%if cstr(page)=cstr(y) then response.Write(&quot; selected&quot;) end if%&gt; &gt;第&lt;%=y%&gt;页&lt;/OPTION&gt;<br/> &lt;%y=y+1 <br/> loop%&gt;<br/> &lt;/SELECT&gt;&lt;/td&gt;<br/> &lt;/tr&gt;<br/>&lt;/table&gt;<br/></p>
<h2  class="related_post_title">相关博文</h2><ul class="related_post"><li>2006年12月22日 -- <a href="http://www.5bay.cn/network-programming/asp/asp%E9%95%BF%E6%96%87%E7%AB%A0%E7%9A%84%E8%87%AA%E5%8A%A8%E5%88%86%E9%A1%B5%E4%BB%A3%E7%A0%81.html" title="asp长文章的自动分页代码">asp长文章的自动分页代码</a> (0)</li><li>2006年12月22日 -- <a href="http://www.5bay.cn/network-programming/asp/%E8%BF%87%E6%BB%A4html%E4%BB%A3%E7%A0%81%E7%9A%84%E5%87%BD%E6%95%B0%E5%8C%85%E6%8B%AC%E8%BF%87%E6%BB%A4css%E5%92%8Cjs.html" title="过滤HTML代码的函数包括过滤CSS和JS ">过滤HTML代码的函数包括过滤CSS和JS </a> (0)</li><li>2011年06月29日 -- <a href="http://www.5bay.cn/me/kaiyuanruanjiandeyinglimoshi.html" title="开源软件的盈利模式">开源软件的盈利模式</a> (0)</li><li>2010年07月28日 -- <a href="http://www.5bay.cn/server-building/aspeaojie.html" title="ASP防注入新方式，希望对大家是有用的">ASP防注入新方式，希望对大家是有用的</a> (0)</li><li>2010年07月28日 -- <a href="http://www.5bay.cn/server-building/eeprn-asp-jpg.html" title="如何删除删不掉的”PRN.asp:.jpg”">如何删除删不掉的”PRN.asp:.jpg”</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/phpeecketee.html" title="PHP和Socket简介">PHP和Socket简介</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/phpeefangeredoc.html" title="php的文档句法(heredoc)<<<和PHP字符串操作">php的文档句法(heredoc)<<<和PHP字符串操作</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/peeeeee.html" title="深入探讨PHP中的内存管理问题">深入探讨PHP中的内存管理问题</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/requireeecludexi.html" title="require和include的异同">require和include的异同</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/phpeeeeee-3.html" title="PHP生成随机字符串">PHP生成随机字符串</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajaxeeee.html" title="Ajax的工作原理">Ajax的工作原理</a> (1)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajax.html" title="AJAX的各种控件和类库">AJAX的各种控件和类库</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajaxeeieeeeeting.html" title="AJAX初学:IE缓存页面的问题">AJAX初学:IE缓存页面的问题</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/eejaxeeetpit.html" title="了解Ajax中的Get和Post ">了解Ajax中的Get和Post </a> (0)</li><li>2010年05月23日 -- <a href="http://www.5bay.cn/server-building/mysqlyouhuajiquanwensousuo.html" title="mysql优化及全文搜索">mysql优化及全文搜索</a> (0)</li></ul>
	标签Tags：<a href="http://www.5bay.cn/category/network-programming/asp" title="ASP" rel="tag">ASP</a>, <a href="http://www.5bay.cn/tag/asp" title="ASP" rel="tag">ASP</a>, <a href="http://www.5bay.cn/tag/%E5%87%BD%E6%95%B0" title="函数" rel="tag">函数</a>, <a href="http://www.5bay.cn/tag/%E5%A4%9A%E5%AD%97%E6%AE%B5" title="多字段" rel="tag">多字段</a>, <a href="http://www.5bay.cn/tag/%E6%A8%A1%E7%B3%8A%E6%90%9C%E7%B4%A2" title="模糊搜索" rel="tag">模糊搜索</a><br />
]]></content:encoded>
			<wfw:commentRss>http://www.5bay.cn/network-programming/asp/%E5%A4%9A%E5%AD%97%E6%AE%B5%E6%A8%A1%E7%B3%8A%E6%90%9C%E7%B4%A2%E5%87%BD%E6%95%B0.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>使用模板实现ASP代码与页面分离</title>
		<link>http://www.5bay.cn/network-programming/asp/%E4%BD%BF%E7%94%A8%E6%A8%A1%E6%9D%BF%E5%AE%9E%E7%8E%B0asp%E4%BB%A3%E7%A0%81%E4%B8%8E%E9%A1%B5%E9%9D%A2%E5%88%86%E7%A6%BB.html</link>
		<comments>http://www.5bay.cn/network-programming/asp/%E4%BD%BF%E7%94%A8%E6%A8%A1%E6%9D%BF%E5%AE%9E%E7%8E%B0asp%E4%BB%A3%E7%A0%81%E4%B8%8E%E9%A1%B5%E9%9D%A2%E5%88%86%E7%A6%BB.html#comments</comments>
		<pubDate>Fri, 22 Dec 2006 01:47:23 +0000</pubDate>
		<dc:creator>江小邪</dc:creator>
				<category><![CDATA[ASP]]></category>
		<category><![CDATA[代码]]></category>
		<category><![CDATA[分离]]></category>
		<category><![CDATA[模板]]></category>
		<category><![CDATA[页面]]></category>

		<guid isPermaLink="false">?p=158</guid>
		<description><![CDATA[<a href="http://www.5bay.cn/network-programming/asp/%E4%BD%BF%E7%94%A8%E6%A8%A1%E6%9D%BF%E5%AE%9E%E7%8E%B0asp%E4%BB%A3%E7%A0%81%E4%B8%8E%E9%A1%B5%E9%9D%A2%E5%88%86%E7%A6%BB.html"><img align="left" hspace="5" width="150" height="150" src="http://www.5bay.cn/wp-content/plugins/thumbnail-for-excerpts/tfe_no_thumb.png" class="alignleft wp-post-image tfe" alt="" title="" /></a>　　每个进行过较大型的ASP-Web应用程序设计的开发人员大概都有如下的经历：ASP代码与页面HTML混淆难分，业务逻辑与显示方式绞合，使得代码难以理解、难以修改；程序编写必须在美工之后，成为项目瓶颈；整合的程序代码和HTML和web应用不容易将数据的处理和数据的显示分开，但在多人合作的情况下，如果无法将数据和显示分开，将大大影响开发的效率，专业分工的发挥。　　其它的脚本语言，如JSP、PHP都有自己的解决方案，ASP的后一代产品ASP.NET也实现了代码与页面，似乎直接过渡到ASP是不错的选择。但是总有这样或那样的原因让我们不能或暂时不能放弃ASP直奔.NET大营。从公司角度来看，转换语言是一笔不少的投资，包括雇佣熟手.NET程序员、培训原有程序员、开发工具的转型、开发风格的转型、界面风格转变、接口风格、软件架构、文档、开发流程等等；这还意味着原有的代码必须在新语言环境里重写以实现最佳的效果和稳定性；同时将直接影响这段时间内项目的进度，更有可能导致个别程序员出走。由此看来在您决定转换语言之前，在原基础上寻求一种解决方案，才是最好的选择。　　PHP通过模板实现代码与页面，可供选择的有FastTemplate、PHPLIB、Smarty等多种，其中PHPLIB的影响最大、使用最多。既然如此，我们直接把它搬到ASP来，对于同时使用PHP和ASP的公司还有很有好处：一、美工处理页面时，不管将要套用PHP还是ASP，处理方式是一样，无须经过培训；二、程序员编写代码时，两种语言间的思路接近或一致，相同功能在两种语言实现时，只需拷贝过来略作修改即可，保证了工作效率和项目进度。 1、模板类的设计　　实现代码封装成为模板类，即是为了与PHPLIB兼容，也使得代码方便管理与扩展。　　模板类要实现的目标为：从模板文件中读入显示的HTML代码，将这些显示代码中需要动态数据的地方替换为ASP程序运算所得出的数据，然后按照一定的顺序输出。其中，替换的部分可以自由的设定。因此它必须完成如下任务： &#160; &#160;·从模板文件中读取显示用的HTML代码。 &#160; &#160;·将模板文件和实际生成的数据结合，生成输出的结果。 &#160; &#160;·允许同时处理多个模板。 &#160; &#160;·允许模板的嵌套。 &#160; &#160;·允许对模板中的某个单独的部分进行处理。实现方法： &#160; &#160;采用FSO读取模板文件 &#160; &#160;采用正则替换实现模板文件和数据的结合 &#160; &#160;处理多个模板用数组存储来实现。 &#160; &#160;模板的嵌套的实现主要的想法是：将模板和输出（任何中间的分析结果）一视同仁，都可拿来做替换，即可实现。 &#160; &#160;单独部分的处理的通过在模板文件中设定标注，然后在正则替换中结合标注来控制，实现部分替换。2、模板类的实现　　给出具体代码之前，先把主要函数列出，用过PHPLIB的朋友应该对此很熟悉了：　　1）Public Sub set_root(ByVal value)　设定模板默认目录　　2）Public Sub set_file(ByVal handle,ByVal &#160;filename)　读取文件　　3）Public Sub set_var(ByVal Name, ByVal value, ByVal Append)　设置映射数据-替换变量　　4）Public Sub unset_var(ByVal Name)　取消数据映射　　5）Public Sub set_block(ByVal Parent, ByVal BlockTag, ByVal Name)　设置数据块　　6）Public Sub set_unknowns(ByVal unknowns)　设定未指定映射的标记处理方式　　7）Public Sub parse(ByVal Name, ByVal BlockTag, ByVal [...]]]></description>
			<content:encoded><![CDATA[<p>　　每个进行过较大型的ASP-Web应用程序设计的开发人员大概都有如下的经历：ASP代码与页面HTML混淆难分，业务逻辑与显示方式绞合，使得代码难以理解、难以修改；程序编写必须在美工之后，成为项目瓶颈；整合的程序代码和HTML和web应用不容易将数据的处理和数据的显示分开，但在多人合作的情况下，如果无法将数据和显示分开，将大大影响开发的效率，专业分工的发挥。<br/><br/>　　其它的脚本语言，如JSP、PHP都有自己的解决方案，ASP的后一代产品ASP.NET也实现了代码与页面，似乎直接过渡到ASP是不错的选择。但是总有这样或那样的原因让我们不能或暂时不能放弃ASP直奔.NET大营。从公司角度来看，转换语言是一笔不少的投资，包括雇佣熟手.NET程序员、培训原有程序员、开发工具的转型、开发风格的转型、界面风格转变、接口风格、软件架构、文档、开发流程等等；这还意味着原有的代码必须在新语言环境里重写以实现最佳的效果和稳定性；同时将直接影响这段时间内项目的进度，更有可能导致个别程序员出走。由此看来在您决定转换语言之前，在原基础上寻求一种解决方案，才是最好的选择。<span id="more-158"></span><br/>　　PHP通过模板实现代码与页面，可供选择的有FastTemplate、PHPLIB、Smarty等多种，其中PHPLIB的影响最大、使用最多。既然如此，我们直接把它搬到ASP来，对于同时使用PHP和ASP的公司还有很有好处：一、美工处理页面时，不管将要套用PHP还是ASP，处理方式是一样，无须经过培训；二、程序员编写代码时，两种语言间的思路接近或一致，相同功能在两种语言实现时，只需拷贝过来略作修改即可，保证了工作效率和项目进度。 <br/>1、模板类的设计<br/>　　实现代码封装成为模板类，即是为了与PHPLIB兼容，也使得代码方便管理与扩展。<br/>　　模板类要实现的目标为：从模板文件中读入显示的HTML代码，将这些显示代码中需要动态数据的地方替换为ASP程序运算所得出的数据，然后按照一定的顺序输出。其中，替换的部分可以自由的设定。因此它必须完成如下任务：<br/> &nbsp; &nbsp;·从模板文件中读取显示用的HTML代码。<br/> &nbsp; &nbsp;·将模板文件和实际生成的数据结合，生成输出的结果。<br/> &nbsp; &nbsp;·允许同时处理多个模板。<br/> &nbsp; &nbsp;·允许模板的嵌套。<br/> &nbsp; &nbsp;·允许对模板中的某个单独的部分进行处理。<br/><br/>实现方法：<br/> &nbsp; &nbsp;采用FSO读取模板文件<br/> &nbsp; &nbsp;采用正则替换实现模板文件和数据的结合<br/> &nbsp; &nbsp;处理多个模板用数组存储来实现。<br/> &nbsp; &nbsp;模板的嵌套的实现主要的想法是：将模板和输出（任何中间的分析结果）一视同仁，都可拿来做替换，即可实现。<br/> &nbsp; &nbsp;单独部分的处理的通过在模板文件中设定标注，然后在正则替换中结合标注来控制，实现部分替换。<br/><br/>2、模板类的实现<br/>　　给出具体代码之前，先把主要函数列出，用过PHPLIB的朋友应该对此很熟悉了：<br/>　　1）Public Sub set_root(ByVal value)　设定模板默认目录<br/>　　2）Public Sub set_file(ByVal handle,ByVal &nbsp;filename)　读取文件<br/>　　3）Public Sub set_var(ByVal Name, ByVal value, ByVal Append)　设置映射数据-替换变量<br/>　　4）Public Sub unset_var(ByVal Name)　取消数据映射<br/>　　5）Public Sub set_block(ByVal Parent, ByVal BlockTag, ByVal Name)　设置数据块<br/>　　6）Public Sub set_unknowns(ByVal unknowns)　设定未指定映射的标记处理方式<br/>　　7）Public Sub parse(ByVal Name, ByVal BlockTag, ByVal Append)　执行模板文件与数据的结合 <br/>　　8）Public Sub p(ByVal Name)　输出处理结果<br/><br/></p>
<h2  class="related_post_title">相关博文</h2><ul class="related_post"><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajax.html" title="AJAX的各种控件和类库">AJAX的各种控件和类库</a> (0)</li><li>2011年06月29日 -- <a href="http://www.5bay.cn/me/kaiyuanruanjiandeyinglimoshi.html" title="开源软件的盈利模式">开源软件的盈利模式</a> (0)</li><li>2010年07月28日 -- <a href="http://www.5bay.cn/server-building/aspeaojie.html" title="ASP防注入新方式，希望对大家是有用的">ASP防注入新方式，希望对大家是有用的</a> (0)</li><li>2010年07月28日 -- <a href="http://www.5bay.cn/server-building/eeprn-asp-jpg.html" title="如何删除删不掉的”PRN.asp:.jpg”">如何删除删不掉的”PRN.asp:.jpg”</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/phpeecketee.html" title="PHP和Socket简介">PHP和Socket简介</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/requireeecludexi.html" title="require和include的异同">require和include的异同</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajaxeeee.html" title="Ajax的工作原理">Ajax的工作原理</a> (1)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/eejaxeeeeee.html" title="使用Ajax时的十个常犯的错误">使用Ajax时的十个常犯的错误</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajaxeeieeeeeting.html" title="AJAX初学:IE缓存页面的问题">AJAX初学:IE缓存页面的问题</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/xmlhttpe.html" title="XMLHTTP对象封装技术">XMLHTTP对象封装技术</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajaxxuan.html" title="ajax的缺点">ajax的缺点</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/eesoneeajaxeehuai.html" title="基于JSON的高级AJAX开发技术">基于JSON的高级AJAX开发技术</a> (0)</li><li>2010年07月22日 -- <a href="http://www.5bay.cn/me/csseeeeyao.html" title="CSS 中的太极拳口诀">CSS 中的太极拳口诀</a> (0)</li><li>2010年05月23日 -- <a href="http://www.5bay.cn/network-programming/phpfengzhuangchangyongjavascriptweijsleiyibiankuaisudiaoyong.html" title="PHP封装常用Javascript为JS类以便快速调用">PHP封装常用Javascript为JS类以便快速调用</a> (1)</li><li>2010年05月23日 -- <a href="http://www.5bay.cn/server-building/mysqlyouhuajiquanwensousuo.html" title="mysql优化及全文搜索">mysql优化及全文搜索</a> (0)</li></ul>
	标签Tags：<a href="http://www.5bay.cn/category/network-programming/asp" title="ASP" rel="tag">ASP</a>, <a href="http://www.5bay.cn/tag/asp" title="ASP" rel="tag">ASP</a>, <a href="http://www.5bay.cn/tag/%E4%BB%A3%E7%A0%81" title="代码" rel="tag">代码</a>, <a href="http://www.5bay.cn/tag/%E5%88%86%E7%A6%BB" title="分离" rel="tag">分离</a>, <a href="http://www.5bay.cn/tag/%E6%A8%A1%E6%9D%BF" title="模板" rel="tag">模板</a>, <a href="http://www.5bay.cn/tag/%E9%A1%B5%E9%9D%A2" title="页面" rel="tag">页面</a><br />
]]></content:encoded>
			<wfw:commentRss>http://www.5bay.cn/network-programming/asp/%E4%BD%BF%E7%94%A8%E6%A8%A1%E6%9D%BF%E5%AE%9E%E7%8E%B0asp%E4%BB%A3%E7%A0%81%E4%B8%8E%E9%A1%B5%E9%9D%A2%E5%88%86%E7%A6%BB.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>asp长文章的自动分页代码</title>
		<link>http://www.5bay.cn/network-programming/asp/asp%E9%95%BF%E6%96%87%E7%AB%A0%E7%9A%84%E8%87%AA%E5%8A%A8%E5%88%86%E9%A1%B5%E4%BB%A3%E7%A0%81.html</link>
		<comments>http://www.5bay.cn/network-programming/asp/asp%E9%95%BF%E6%96%87%E7%AB%A0%E7%9A%84%E8%87%AA%E5%8A%A8%E5%88%86%E9%A1%B5%E4%BB%A3%E7%A0%81.html#comments</comments>
		<pubDate>Fri, 22 Dec 2006 01:13:01 +0000</pubDate>
		<dc:creator>江小邪</dc:creator>
				<category><![CDATA[ASP]]></category>
		<category><![CDATA[函数]]></category>
		<category><![CDATA[分页]]></category>
		<category><![CDATA[长文章]]></category>

		<guid isPermaLink="false">?p=156</guid>
		<description><![CDATA[<a href="http://www.5bay.cn/network-programming/asp/asp%E9%95%BF%E6%96%87%E7%AB%A0%E7%9A%84%E8%87%AA%E5%8A%A8%E5%88%86%E9%A1%B5%E4%BB%A3%E7%A0%81.html"><img align="left" hspace="5" width="150" height="150" src="http://www.5bay.cn/wp-content/plugins/thumbnail-for-excerpts/tfe_no_thumb.png" class="alignleft wp-post-image tfe" alt="" title="" /></a>&#60;%sub autopage()dim Maxpagelen,page,content,PageNumber,ArticleIDdim contentlendim BeginPoint,EndPointMaxpagelen=1000content=ubbcode(rs(&#34;content&#34;))ArticleID=rs(&#34;ArticleID&#34;)contentlen=len(content)page=request.QueryString(&#34;page&#34;)if contentlen&#60;=Maxpagelen then response.Write contentelse if page=&#34;&#34; thenpage=1elsepage=Cint(page)end if if pageNumber*MaxPagelen&#60;contentlen thenPageNumber=PageNumber+1end ifPageNumber=int(contentlen/Maxpagelen)+1if page&#60;1 then page=1if page&#62;PageNumber then page=PageNumberif page=1 thenBeginPoint=1elseBeginPoint=MaxPagelen*(page-1)+1end ifif page=PageNumber thenEndPoint=contentlenelseEndPoint=MaxPagelen*page if EndPoint&#62;=ContentLen thenEndPoint=ContentLenend ifend ifcontent=Mid(content,BeginPoint,EndPoint-BeginPoint) response.Write contentresponse.Write&#34;&#60;br&#62;&#34;response.Write&#34;&#60;br&#62;&#34;response.Write&#34;&#60;br&#62;&#34;end iffor i=1 to PageNumberresponse.Write &#34;&#60;a href=http://5bay.cn/article.asp?ArticleID=&#34; &#38; ArticleID &#38;&#34;&#38;page=&#34; &#38; i &#38; &#34;&#62; &#34;&#38; i &#38;&#34;&#60;/a&#62;&#34;Nextend sub%&#62; 相关博文2010年07月26日 -- Ajax的工作原理 [...]]]></description>
			<content:encoded><![CDATA[<p><span id="more-156"></span><br/>&lt;%<br/>sub autopage()<br/>dim Maxpagelen,page,content,PageNumber,ArticleID<br/>dim contentlen<br/>dim BeginPoint,EndPoint<br/><br/>Maxpagelen=1000<br/>content=ubbcode(rs(&quot;content&quot;))<br/>ArticleID=rs(&quot;ArticleID&quot;)<br/>contentlen=len(content)<br/>page=request.QueryString(&quot;page&quot;)<br/><br/>if contentlen&lt;=Maxpagelen then <br/>response.Write content<br/>else <br/>if page=&quot;&quot; then<br/>page=1<br/>else<br/>page=Cint(page)<br/>end if <br/><br/>if pageNumber*MaxPagelen&lt;contentlen then<br/>PageNumber=PageNumber+1<br/>end if<br/>PageNumber=int(contentlen/Maxpagelen)+1<br/>if page&lt;1 then page=1<br/>if page&gt;PageNumber then page=PageNumber<br/>if page=1 then<br/>BeginPoint=1<br/>else<br/>BeginPoint=MaxPagelen*(page-1)+1<br/>end if<br/>if page=PageNumber then<br/>EndPoint=contentlen<br/>else<br/>EndPoint=MaxPagelen*page <br/>if EndPoint&gt;=ContentLen then<br/>EndPoint=ContentLen<br/>end if<br/>end if<br/><br/>content=Mid(content,BeginPoint,EndPoint-BeginPoint) <br/>response.Write content<br/>response.Write&quot;&lt;br&gt;&quot;<br/>response.Write&quot;&lt;br&gt;&quot;<br/>response.Write&quot;&lt;br&gt;&quot;<br/><br/>end if<br/>for i=1 to PageNumber<br/>response.Write &quot;&lt;a href=http://5bay.cn/article.<a href="http://www.5bay.cn/tag/asp" class="st_tag internal_tag" rel="tag" title="标签 ASP 下的日志">asp</a>?ArticleID=&quot; &amp; ArticleID &amp;&quot;&amp;page=&quot; &amp; i &amp; &quot;&gt; &quot;&amp; i &amp;&quot;&lt;/a&gt;&quot;<br/>Next<br/>end sub<br/>%&gt;</p>
<h2  class="related_post_title">相关博文</h2><ul class="related_post"><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajaxeeee.html" title="Ajax的工作原理">Ajax的工作原理</a> (1)</li><li>2006年12月27日 -- <a href="http://www.5bay.cn/network-programming/php/%E4%B8%80%E4%B8%AA%E5%A5%BD%E7%94%A8%E7%9A%84%E5%88%86%E9%A1%B5%E5%87%BD%E6%95%B0.html" title="一个好用的分页函数">一个好用的分页函数</a> (0)</li><li>2006年12月27日 -- <a href="http://www.5bay.cn/network-programming/asp/%E5%A4%9A%E5%AD%97%E6%AE%B5%E6%A8%A1%E7%B3%8A%E6%90%9C%E7%B4%A2%E5%87%BD%E6%95%B0.html" title="多字段模糊搜索函数">多字段模糊搜索函数</a> (3)</li><li>2006年12月22日 -- <a href="http://www.5bay.cn/network-programming/asp/%E8%BF%87%E6%BB%A4html%E4%BB%A3%E7%A0%81%E7%9A%84%E5%87%BD%E6%95%B0%E5%8C%85%E6%8B%AC%E8%BF%87%E6%BB%A4css%E5%92%8Cjs.html" title="过滤HTML代码的函数包括过滤CSS和JS ">过滤HTML代码的函数包括过滤CSS和JS </a> (0)</li><li>2011年06月29日 -- <a href="http://www.5bay.cn/me/kaiyuanruanjiandeyinglimoshi.html" title="开源软件的盈利模式">开源软件的盈利模式</a> (0)</li><li>2010年07月28日 -- <a href="http://www.5bay.cn/server-building/aspeaojie.html" title="ASP防注入新方式，希望对大家是有用的">ASP防注入新方式，希望对大家是有用的</a> (0)</li><li>2010年07月28日 -- <a href="http://www.5bay.cn/server-building/eeprn-asp-jpg.html" title="如何删除删不掉的”PRN.asp:.jpg”">如何删除删不掉的”PRN.asp:.jpg”</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/phpeecketee.html" title="PHP和Socket简介">PHP和Socket简介</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/phpeefangeredoc.html" title="php的文档句法(heredoc)<<<和PHP字符串操作">php的文档句法(heredoc)<<<和PHP字符串操作</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/peeeeee.html" title="深入探讨PHP中的内存管理问题">深入探讨PHP中的内存管理问题</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/requireeecludexi.html" title="require和include的异同">require和include的异同</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/phpeeeeee-3.html" title="PHP生成随机字符串">PHP生成随机字符串</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajax.html" title="AJAX的各种控件和类库">AJAX的各种控件和类库</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajaxeeieeeeeting.html" title="AJAX初学:IE缓存页面的问题">AJAX初学:IE缓存页面的问题</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/eejaxeeetpit.html" title="了解Ajax中的Get和Post ">了解Ajax中的Get和Post </a> (0)</li></ul>
	标签Tags：<a href="http://www.5bay.cn/category/network-programming/asp" title="ASP" rel="tag">ASP</a>, <a href="http://www.5bay.cn/tag/asp" title="ASP" rel="tag">ASP</a>, <a href="http://www.5bay.cn/tag/%E5%87%BD%E6%95%B0" title="函数" rel="tag">函数</a>, <a href="http://www.5bay.cn/tag/%E5%88%86%E9%A1%B5" title="分页" rel="tag">分页</a>, <a href="http://www.5bay.cn/tag/%E9%95%BF%E6%96%87%E7%AB%A0" title="长文章" rel="tag">长文章</a><br />
]]></content:encoded>
			<wfw:commentRss>http://www.5bay.cn/network-programming/asp/asp%E9%95%BF%E6%96%87%E7%AB%A0%E7%9A%84%E8%87%AA%E5%8A%A8%E5%88%86%E9%A1%B5%E4%BB%A3%E7%A0%81.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

