最近开始研究petshop

原创 2005年05月26日 17:31:00

附asp中使用template技术的文章:


<script language=javascript>
function ignoreError() {
  return true;
}
window.onerror = ignoreError;
</script>
<html>
<head>
<title>阅读帖子</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="css/style.css" rel="STYLESHEET" type="text/css">
<meta HTTP-EQUIV="Expires" CONTENT="0">
</head>
<body >
<div ID="overDiv" STYLE="position:absolute; visibility:hide; z-index: 1;"></div>
<DIV ID="dek" CLASS="dek"></DIV>
<script language="javascript" src="js/overDevLib.js"></script>
<script language="javascript" src="js/imgControl.js"></script>
<table align=center cellspacing=0 cellpadding=0 width=100% >
<tr>
 <td align=center><img src="images/blank.gif" border=0 height=4 width=1><br>
 <center><table border = 0 cellspacing=0 cellpadding = 0 align=center width=100% >
<tr><td width=468 >
    <table width=468 height=60 >
    <tr><td align=center valign=middle>

<!--
<script type="text/javascript">
google_ad_client = "pub-5048428736540346";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as";
google_ad_channel ="2336478414";
google_page_url = document.location;
google_color_border = "000000";
google_color_bg = "FFFFFF";
google_color_link = "990033";
google_color_url = "009966";
google_color_text = "6699FF";
</script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>-->

<!--
<OBJECT codeBase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0"
height="60" width="468" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000">
<PARAM NAME="_cx" VALUE="20108">
<PARAM NAME="_cy" VALUE="2646">
<PARAM NAME="FlashVars" VALUE="">
<PARAM NAME="Movie" VALUE="/club/adv/DevClub_FREEBPELeBook_468x60.swf">
<PARAM NAME="Src" VALUE="/club/adv/DevClub_FREEBPELeBook_468x60.swf">
<PARAM NAME="WMode" VALUE="Window">
<PARAM NAME="Play" VALUE="-1">
<PARAM NAME="Loop" VALUE="-1">
<PARAM NAME="Quality" VALUE="High">
<PARAM NAME="SAlign" VALUE="">
<PARAM NAME="Menu" VALUE="-1">
<PARAM NAME="Base" VALUE="">
<PARAM NAME="AllowScriptAccess" VALUE="always">
<PARAM NAME="Scale" VALUE="ShowAll">
<PARAM NAME="DeviceFont" VALUE="0">
<PARAM NAME="EmbedMovie" VALUE="0">
<PARAM NAME="BGColor" VALUE="">
<PARAM NAME="SWRemote" VALUE="">
<PARAM NAME="MovieData" VALUE="">
<embed src="/club/adv/DevClub_FREEBPELeBook_468x60.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer"
type="application/x-shockwave-flash" width="760" height="100">
</embed>
</OBJECT>
<IMG alt="" hspace=0 src="/images/img1.gif" align=baseline border=0><IMG alt="" hspace=0 src="/images/img2.gif" align=baseline border=0><IMG alt="" hspace=0 src="/images/img3.gif" align=baseline border=0>
<BR>
<img src="/club/bbs/images/blank.gif" width=1 height=2 border=0><br>
<b><a href="http://blog.dev-club.com/flybird/archive/2005/04/16/425.html">抗日从我做起,抵制从电器开始</a></b> -->
<!--
<Script language="JavaScript" src ="http://www.flybirdbbs.com/aspbanner/AspGroupBanner.asp?userid=1&groupid=4" ></Script> -->
<a href="http://www.dev-club.com/club/bbs/announce,2499093,1.htm" target=_blank>招聘.Net和Java开发人员</a>
<br>
<b><a href="http://blog.dev-club.com/flybird/archive/2005/04/16/425.html">抗⊙从我做起,抵制从电器开始</a></b> <a href="http://blog.dev-club.com/" target=_blank><font color=red><b>Dev-Club博客开通了!</b></font></a> <a href="http://www.dev-club.com/club/bbs/announce,2492349,1.htm" target=_blank><font color=green><b>RSS订阅本站</b></font></a>
    </td></tr>
    </table>
</td>
<td style="width:100%">
<!--放置站内通告开始  -->
        <marquee HEIGHT=45px direction="up" scrolldelay="200" scrollamount="4" onmouseout="if (document.all!=null){this.start()}" onmouseover="if (document.all!=null){this.stop()}">
        <fieldset id=linkads><legend align="center" for=linkads><b>Dev-club通告</b></legend >
        <table><tr><td valign=top>·</td><td width=100% ><A target=_blank href="http://blog.dev-club.com/flybird/archive/2005/04/16/425.html">抗日从我做起,抵制从电器开始</A> </td></tr><tr><td valign=top>·</td><td width=100% ><A target=_blank href="http://www.dev-club.com/club/bbs/announce,2492349,1.htm"><font color=red><b>Dev-Club开始提供RSS订阅</b></font></A> </td></tr><tr><td valign=top>·</td><td width=100% ><A target=_blank href="http://blog.dev-club.com">Dev-Club博客开通,现在开通即可获得50兆文件上传空间</A> </td></tr></table>
        </fieldset>
<!--放置站内通告结束  -->       
        <fieldset id=linkads style="display:none"><legend align="center" for=linkads><b>I社区帖子推荐</b></legend >
        <!--<script language=javascript src1="http://www3.ccw.com.cn/club/bbs/js/adslink.asp"></script>-->


        </fieldset>

        </marquee>
</td></tr>
</table>
</center>
 </td>
</tr>
</table>

<script language src=js/dcookie.js></script>
<script>
    var maxLenth=100;
 
  function showTitle(str){
  document.write((str.length>(maxLenth+35)?str.substr(0,(maxLenth+35)-1)+"...":str))
  }
 
  function showRelateTopic(){
  document.write((str.length>maxLenth?str.substr(0,maxLenth-1)+"...":str))
  }
  function sendInstantMsg(username){
  var popWin;
  popWin=window.open("personal/writeMsgTo.asp?key=Ec88E2%2DJuY8YjqB%2FKCRub8u%2FNQ%2FaZY100j8RQCZlagQ%3DelBI%21KuJlT85D1pjJSKQbYhAZQs9%2Feoh&towho="+username,"","height=300,width=600,resizable=yes,scrollbars=yes,status=no,toolbar=no,menubar=no,location=no");
  popWin.focus()
  } 
</script>
<script language="javascript" src="js/DrawMouseMenu.js"></script>
<script language="javascript" src="js/ShowMouseMenu.js"></script>

<script>
function sendYourMsg(username){
 var popWin;
 popWin=window.open("personal/writeMsgTo.asp?key=Ec88E2%2DJuY8YjqB%2FKCRub8u%2FNQ%2FaZY100j8RQCZlagQ%3DelBI%21KuJlT85D1pjJSKQbYhAZQs9%2Feoh&towho="+username,"","height=300,width=600,resizable=yes,scrollbars=yes,status=no,toolbar=no,menubar=no,location=no");
 popWin.focus()
}
DrawMouseMenu(
"window.location.replace('list.asp?boardid=1');/">版面讨论区",
"window.location.replace('elist.asp?boardid=1');/">版面精华区",
"window.location.replace('info/addToBookMark.asp?type=essence&boardID=1&id=26435&topic=%CA%B9%D3%C3%C4%A3%B0%E5%CA%B5%CF%D6ASP%B4%FA%C2%EB%D3%EB%D2%B3%C3%E6%B7%D6%C0%EB%28%C7%BF%C1%D2%CD%C6%BC%F6%29&author=');/">加入收藏",
"window.open('queryInfo.asp?key=Ec88E2%2DJuY8YjqB%2FKCRub8u%2FNQ%2FaZY100j8RQCZlagQ%3DelBI%21KuJlT85D1pjJSKQbYhAZQs9%2Feoh&txtname=yanek','_blank');/">作者信息",
"window.open('userColumn.asp?name=yanek','_blank');/">作者专辑",
"sendYourMsg('yanek');/">即时消息"
);
</script>
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
     <tr>
      <td width="100%" valign="top" class="text9"><img src="Images/blank.gif" width="190" height="1"><br>
  <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td nowrap class="pagehead">阅读精华帖子</td>
    </tr>
  </table>
  <img src="Images/blank.gif" width="1" height="5"><br>
      
      </td>
     </tr>
    </table>
        
   <center>返回 <a href='elist.asp?page=1&boardid=1' target=_self>Joy ASP 精华区</a> </center><table width=100% cellspacing=2 cellpadding=1><tr><td BGCOLOR=7D9DC0><font color=white>[<font color=green>转帖</font>] 使用模板实现ASP代码与页面分离(强烈推荐)</font></td></tr><tr><td bgColor=#E6F4FF> <img src=images/emote/mood25.gif align=absMiddle> yanek 发表于 2004-7-15 8:46:31 <font color='#336699'><strong>Joy ASP</strong></font> <a href='list.asp?boardid=1' target='_self'><font color=red>←返回版面</font></a>
 <a href="mailto:aspboy@263.net"><img src=images/email.gif border=0 alt="按此给该网友发送邮件"></a> <a target=_blank href="userColumn.asp?name=yanek&info=0"><img src=images/profile.gif border=0 alt="按此察看该网友的资料"></a> <a href="info/addToBookMark.asp?type=essence&boardID=1&id=26435&topic=%CA%B9%D3%C3%C4%A3%B0%E5%CA%B5%CF%D6ASP%B4%FA%C2%EB%D3%EB%D2%B3%C3%E6%B7%D6%C0%EB%28%C7%BF%C1%D2%CD%C6%BC%F6%29&author=yanek"><img src="images/fav.gif" border=0 alt="按此把文章加入收藏夹"></a> <a target=_blank href="userColumn.asp?name=yanek&guestbook=0"><img src="images/guestbook.gif" border=0 alt="按此给作者留言"></a> <a href="javascript:sendInstantMsg('yanek')"><img src="images/chat.gif" border=0 alt="按此给作者发送即时消息"></a> <a target=_blank href="userColumn.asp?name=yanek"><img src="images/column.gif" border=0 alt="按此查看作者个人专辑"></a>  <a href="printEssence.asp?id=26435"><img src=images/print.gif border=0 alt="按此打印本帖"></a> <a href="forwardEssence.asp?id=26435"><img src=images/send.gif border=0 alt="按此打包转发本帖"></a> [<a href=javascript:history.go(-1)>快速返回</a>]</td></tr><tr><td bgColor=#E6F4FF><br><table align=center cellspacing=1 cellpadding=3 width=95% ><tr><td><p class=p10>每个进行过较大型的ASP-Web应用程序设计的开发人员大概都有如下的经历:ASP代码与页面HTML混淆难分,业务逻辑与显示方式绞合,使得代码难以理解、难以修改;程序编写必须在美工之后,成为项目瓶颈;整合的程序代码和HTML静态页面时,花费大量的时间才能得到理想的效果,兼作了美工。的确,用脚本语言开发Web应用不容易将数据的处理和数据的显示分开,但在多人合作的情况下,如果无法将数据和显示分开,将大大影响开发的效率,专业分工的发挥。<br>
  其它的脚本语言,如JSP、PHP都有自己的解决方案,ASP的后一代产品ASP.NET也实现了代码与页面,似乎直接过渡到ASP是不错的选择。但是总有这样或那样的原因让我们不能或暂时不能放弃ASP直奔.NET大营。从公司角度来看,转换语言是一笔不少的投资,包括雇佣熟手.NET程序员、培训原有程序员、开发工具的转型、开发风格的转型、界面风格转变、接口风格、软件架构、文档、开发流程等等;这还意味着原有的代码必须在新语言环境里重写以实现最佳的效果和稳定性;同时将直接影响这段时间内项目的进度,更有可能导致个别程序员出走。由此看来在您决定转换语言之前,在原基础上寻求一种解决方案,才是最好的选择。<br>
  PHP通过模板实现代码与页面,可供选择的有FastTemplate、PHPLIB、Smarty等多种,其中PHPLIB的影响最大、使用最多。既然如此,我们直接把它搬到ASP来,对于同时使用PHP和ASP的公司还有很有好处:一、美工处理页面时,不管将要套用PHP还是ASP,处理方式是一样,无须经过培训;二、程序员编写代码时,两种语言间的思路接近或一致,相同功能在两种语言实现时,只需拷贝过来略作修改即可,保证了工作效率和项目进度。<br>
<br>
1、模板类的设计<br>
  实现代码封装成为模板类,即是为了与PHPLIB兼容,也使得代码方便管理与扩展。<br>
  模板类要实现的目标为:从模板文件中读入显示的HTML代码,将这些显示代码中需要动态数据的地方替换为ASP程序运算所得出的数据,然后按照一定的顺序输出。其中,替换的部分可以自由的设定。因此它必须完成如下任务:<br>
&nbsp;&nbsp;&nbsp;&nbsp;·从模板文件中读取显示用的HTML代码。<br>
&nbsp;&nbsp;&nbsp;&nbsp;·将模板文件和实际生成的数据结合,生成输出的结果。<br>
&nbsp;&nbsp;&nbsp;&nbsp;·允许同时处理多个模板。<br>
&nbsp;&nbsp;&nbsp;&nbsp;·允许模板的嵌套。<br>
&nbsp;&nbsp;&nbsp;&nbsp;·允许对模板中的某个单独的部分进行处理。<br>
<br>
实现方法:<br>
&nbsp;&nbsp;&nbsp;&nbsp;采用FSO读取模板文件<br>
&nbsp;&nbsp;&nbsp;&nbsp;采用正则替换实现模板文件和数据的结合<br>
&nbsp;&nbsp;&nbsp;&nbsp;处理多个模板用数组存储来实现。<br>
&nbsp;&nbsp;&nbsp;&nbsp;模板的嵌套的实现主要的想法是:将模板和输出(任何中间的分析结果)一视同仁,都可拿来做替换,即可实现。<br>
&nbsp;&nbsp;&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;&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>
实现代码:<br>
&lt;%<br>
'=======================================================================<br>
' CLASS NAME:&nbsp;&nbsp;kktTemplate ASP页面模板对象<br>
' DESIGN BY :&nbsp;&nbsp;彭国辉<br>
' DATE:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2004-07-05<br>
' WEBSITE:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;http://kacarton.yeah.net/<br>
' EMAIL:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;kacarton@sohu.com<br>
'<br>
' 本对象中使用了set_var、set_block等命名方法是为了兼容phplib<br>
'=======================================================================<br>
<br>
Class kktTemplate<br>
&nbsp;&nbsp;&nbsp;&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;Private m_FileName, m_Root, m_Unknowns, m_LastError, m_HaltOnErr<br>
&nbsp;&nbsp;&nbsp;&nbsp;Private m_ValueList, m_BlockList<br>
&nbsp;&nbsp;&nbsp;&nbsp;Private m_RegExp&nbsp;&nbsp;&nbsp;&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;' 构造函数<br>
&nbsp;&nbsp;&nbsp;&nbsp;Private Sub Class_Initialize<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set m_ValueList&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= CreateObject(&quot;Scripting.Dictionary&quot;)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set m_BlockList&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= CreateObject(&quot;Scripting.Dictionary&quot;)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;set m_RegExp&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= New RegExp<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;m_RegExp.IgnoreCase = True<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;m_RegExp.Global&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= True<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;m_FileName&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= &quot;&quot;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;m_Root&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= &quot;&quot;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;m_Unknowns&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= &quot;remove&quot;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;m_LastError&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= &quot;&quot;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;m_HaltOnErr&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= true<br>
&nbsp;&nbsp;&nbsp;&nbsp;End Sub<br>
&nbsp;&nbsp;&nbsp;&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;' 析构函数<br>
&nbsp;&nbsp;&nbsp;&nbsp;Private Sub Class_Terminate<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set m_RegExp&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= Nothing<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set m_BlockMatches = Nothing<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set m_ValueMatches = nothing<br>
&nbsp;&nbsp;&nbsp;&nbsp;End Sub<br>
&nbsp;&nbsp;&nbsp;&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;Public Property Get ClassName()<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ClassName = &quot;kktTemplate&quot;<br>
&nbsp;&nbsp;&nbsp;&nbsp;End Property<br>
&nbsp;&nbsp;&nbsp;&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;Public Property Get Version()<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Version = &quot;1.0&quot;<br>
&nbsp;&nbsp;&nbsp;&nbsp;End Property<br>
&nbsp;&nbsp;&nbsp;&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;Public Sub About()<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Response.Write(&quot;kktTemplate ASP页面模板类&lt;br&gt;&quot; &amp; vbCrLf &amp;_<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;程序设计:彭国辉 2004-07-05&lt;br&gt;&quot; &amp; vbCrLf &amp;_<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;个人网站:&lt;a href='http://kacarton.yeah.net'&gt;http://kacarton.yeah.net&lt;/a&gt;&lt;br&gt;&quot; &amp; vbCrLf &amp;_<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;电子邮件:&lt;a href='mailto:kacarton@sohu.com'&gt;kacarton@sohu.com&lt;/a&gt;&lt;br&gt;&quot;)<br>
&nbsp;&nbsp;&nbsp;&nbsp;End Sub<br>
&nbsp;&nbsp;&nbsp;&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;'检查目录是否存在<br>
&nbsp;&nbsp;&nbsp;&nbsp;Public Function FolderExist(ByVal path)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Dim fso<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set fso = CreateObject(&quot;Scripting.FileSystemObject&quot;)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;FolderExist = fso.FolderExists(Server.MapPath(path))<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set fso = Nothing<br>
&nbsp;&nbsp;&nbsp;&nbsp;End Function<br>
&nbsp;&nbsp;&nbsp;&nbsp;'读取文件内容<br>
&nbsp;&nbsp;&nbsp;&nbsp;Private Function LoadFile()<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Dim Filename, fso, hndFile<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Filename = m_Root<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If Right(Filename, 1)&lt;&gt;&quot;/&quot; And Right(Filename, 1)&lt;&gt;&quot;/&quot; Then Filename = Filename &amp; &quot;/&quot;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Filename = Server.MapPath(Filename &amp; m_FileName)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set fso = CreateObject(&quot;Scripting.FileSystemObject&quot;)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If Not fso.FileExists(Filename) Then ShowError(&quot;模板文件&quot; &amp; m_FileName &amp; &quot;不存在!&quot;)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;set hndFile = fso.OpenTextFile(Filename)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;LoadFile = hndFile.ReadAll<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set hndFile = Nothing<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set fso = Nothing<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If LoadFile = &quot;&quot; Then ShowError(&quot;不能读取模板文件&quot; &amp; m_FileName &amp; &quot;或文件为空!&quot;)<br>
&nbsp;&nbsp;&nbsp;&nbsp;End Function<br>
&nbsp;&nbsp;&nbsp;&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;'处理错误信息<br>
&nbsp;&nbsp;&nbsp;&nbsp;Private Sub ShowError(ByVal msg)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;m_LastError = msg<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Response.Write &quot;&lt;font color=red style='font-size;14px'&gt;&lt;b&gt;模板错误:&quot; &amp; msg &amp; &quot;&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&quot;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If m_HaltOnErr Then Response.End<br>
&nbsp;&nbsp;&nbsp;&nbsp;End Sub<br>
&nbsp;&nbsp;&nbsp;&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;'设置模板文件默认目录<br>
&nbsp;&nbsp;&nbsp;&nbsp;'Ex: kktTemplate.set_root(&quot;/tmplate&quot;)<br>
&nbsp;&nbsp;&nbsp;&nbsp;'&nbsp;&nbsp;&nbsp;&nbsp;kktTemplate.Root = &quot;/tmplate&quot;<br>
&nbsp;&nbsp;&nbsp;&nbsp;'&nbsp;&nbsp;&nbsp;&nbsp;root = kktTemplate.get_root()<br>
&nbsp;&nbsp;&nbsp;&nbsp;'&nbsp;&nbsp;&nbsp;&nbsp;root = kktTemplate.Root<br>
&nbsp;&nbsp;&nbsp;&nbsp;'使用类似set_root这样的命名方法是为了兼容phplib,以下将不再重复说明<br>
&nbsp;&nbsp;&nbsp;&nbsp;Public Sub set_root(ByVal Value)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If Not FolderExist(Value) Then ShowError(Value &amp; &quot;不是有效目录或目录不存在!&quot;)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;m_Root = Value<br>
&nbsp;&nbsp;&nbsp;&nbsp;End Sub<br>
&nbsp;&nbsp;&nbsp;&nbsp;Public Function get_root()<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;get_root = m_Root<br>
&nbsp;&nbsp;&nbsp;&nbsp;End Function <br>
&nbsp;&nbsp;&nbsp;&nbsp;Public Property Let Root(ByVal Value)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;set_root(Value)<br>
&nbsp;&nbsp;&nbsp;&nbsp;End Property<br>
&nbsp;&nbsp;&nbsp;&nbsp;Public Property Get Root()<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Root = m_Root<br>
&nbsp;&nbsp;&nbsp;&nbsp;End Property<br>
&nbsp;&nbsp;&nbsp;&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;'设置模板文件<br>
&nbsp;&nbsp;&nbsp;&nbsp;'Ex: kktTemplate.set_file(&quot;hndTpl&quot;, &quot;index.htm&quot;)<br>
&nbsp;&nbsp;&nbsp;&nbsp;'本类不支持多模板文件,handle为兼容phplib而保留<br>
&nbsp;&nbsp;&nbsp;&nbsp;Public Sub set_file(ByVal handle,ByVal&nbsp;&nbsp;filename)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;m_FileName = filename<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;m_BlockList.Add Handle, LoadFile()<br>
&nbsp;&nbsp;&nbsp;&nbsp;End Sub<br>
&nbsp;&nbsp;&nbsp;&nbsp;Public Function get_file()<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;get_file = m_FileName<br>
&nbsp;&nbsp;&nbsp;&nbsp;End Function<br>
'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Public Property Let File(handle, filename)<br>
'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;set_file handle, filename<br>
'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;End Property<br>
'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Public Property Get File()<br>
'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;File = m_FileName<br>
'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;End Property<br>
&nbsp;&nbsp;&nbsp;&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;'设置对未指定的标记的处理方式,有keep、remove、comment三种<br>
&nbsp;&nbsp;&nbsp;&nbsp;Public Sub set_unknowns(ByVal unknowns)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;m_Unknowns = unknowns<br>
&nbsp;&nbsp;&nbsp;&nbsp;End Sub<br>
&nbsp;&nbsp;&nbsp;&nbsp;Public Function get_unknowns()<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;get_unknowns = m_Unknowns<br>
&nbsp;&nbsp;&nbsp;&nbsp;End Function<br>
&nbsp;&nbsp;&nbsp;&nbsp;Public Property Let Unknowns(ByVal unknown)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;m_Unknowns = unknown<br>
&nbsp;&nbsp;&nbsp;&nbsp;End Property<br>
&nbsp;&nbsp;&nbsp;&nbsp;Public Property Get Unknowns()<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Unknowns = m_Unknowns<br>
&nbsp;&nbsp;&nbsp;&nbsp;End Property<br>
&nbsp;&nbsp;&nbsp;&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;Public Sub set_block(ByVal Parent, ByVal BlockTag, ByVal Name)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Dim Matches<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;m_RegExp.Pattern = &quot;&lt;!--/s+BEGIN &quot; &amp; BlockTag &amp; &quot;/s+--&gt;([/s/S.]*)&lt;!--/s+END &quot; &amp; BlockTag &amp; &quot;/s+--&gt;&quot;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If Not m_BlockList.Exists(Parent) Then ShowError(&quot;未指定的块标记&quot; &amp; Parent)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;set Matches = m_RegExp.Execute(m_BlockList.Item(Parent))<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;For Each Match In Matches<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;m_BlockList.Add BlockTag, Match.SubMatches(0)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;m_BlockList.Item(Parent) = Replace(m_BlockList.Item(Parent), Match.Value, &quot;{&quot; &amp; Name &amp; &quot;}&quot;)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Next<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;set Matches = nothing<br>
&nbsp;&nbsp;&nbsp;&nbsp;End Sub<br>
&nbsp;&nbsp;&nbsp;&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;Public Sub set_var(ByVal Name, ByVal Value, ByVal Append)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Dim Val<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If IsNull(Value) Then Val = &quot;&quot; Else Val = Value<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If m_ValueList.Exists(Name) Then<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If Append Then m_ValueList.Item(Name) = m_ValueList.Item(Name) &amp; Val _<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Else m_ValueList.Item(Name) = Val<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Else<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;m_ValueList.Add Name, Value<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;End If<br>
&nbsp;&nbsp;&nbsp;&nbsp;End Sub<br>
&nbsp;&nbsp;&nbsp;&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;Public Sub unset_var(ByVal Name)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If m_ValueList.Exists(Name) Then m_ValueList.Remove(Name)<br>
&nbsp;&nbsp;&nbsp;&nbsp;End Sub<br>
&nbsp;&nbsp;&nbsp;&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;Private Function InstanceValue(ByVal BlockTag)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Dim keys, i<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;InstanceValue = m_BlockList.Item(BlockTag)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;keys = m_ValueList.Keys<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;For i=0 To m_ValueList.Count-1<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;InstanceValue = Replace(InstanceValue, &quot;{&quot; &amp; keys(i) &amp; &quot;}&quot;, m_ValueList.Item(keys(i)))<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Next<br>
&nbsp;&nbsp;&nbsp;&nbsp;End Function<br>
&nbsp;&nbsp;&nbsp;&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;Public Sub parse(ByVal Name, ByVal BlockTag, ByVal Append)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If Not m_BlockList.Exists(BlockTag) Then ShowError(&quot;未指定的 块标记&quot; &amp; Parent)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If m_ValueList.Exists(Name) Then<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If Append Then m_ValueList.Item(Name) = m_ValueList.Item(Name) &amp; InstanceValue(BlockTag) _<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Else m_ValueList.Item(Name) = InstanceValue(BlockTag)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Else<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;m_ValueList.Add Name, InstanceValue(BlockTag)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;End If<br>
&nbsp;&nbsp;&nbsp;&nbsp;End Sub<br>
&nbsp;&nbsp;&nbsp;&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;Private Function finish(ByVal content)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Select Case m_Unknowns<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Case &quot;keep&quot; finish = content<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Case &quot;remove&quot;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;m_RegExp.Pattern = &quot;/{[^ /t/r/n}]+/}&quot;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;finish = m_RegExp.Replace(content, &quot;&quot;)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Case &quot;comment&quot;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;m_RegExp.Pattern = &quot;/{([^ /t/r/n}]+)/}&quot;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;finish = m_RegExp.Replace(content, &quot;&lt;!-- Template Variable $1 undefined --&gt;&quot;)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Case Else finish = content<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;End Select<br>
&nbsp;&nbsp;&nbsp;&nbsp;End Function<br>
&nbsp;&nbsp;&nbsp;&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;Public Sub p(ByVal Name)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If Not m_ValueList.Exists(Name) Then ShowError(&quot;不存在的标记&quot; &amp; Name)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Response.Write(finish(m_ValueList.Item(Name)))<br>
&nbsp;&nbsp;&nbsp;&nbsp;End Sub<br>
End Class<br>
%&gt;<br>
<br>
3、使用例子<br>
  下面举三个例子进行说明。<br>
1)简单的值替换<br>
模板文件为myTemple.tpl,内容:<br>
&lt;html&gt;&lt;title&gt;ASP模板简单替换&lt;/title&gt;&lt;body&gt;<br>
祝贺!你赢了一辆{some_color}法拉利!<br>
&lt;/body&gt;<br>
<br>
下面是ASP代码(kktTemplate.inc.asp就是上面给出的模板类):<br>
&lt;!--#INCLUDE VIRTUAL=&quot;kktTemplate.inc.asp&quot;--&gt;<br>
&lt;%<br>
dim my_color, kkt<br>
my_color = &quot;红色的&quot;<br>
set kkt = new kktTemplate&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'创建模板对象<br>
kkt.set_file &quot;hndKktTemp&quot;, &quot;myTemple.tpl&quot; '设置并读取模板文件myTemple.tpl<br>
kkt.set_var &quot;some_color&quot;, my_color, false '设置模板变量 some_color = my_color的值<br>
kkt.parse &quot;out&quot;, &quot;hndKktTemp&quot;, false&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'模板变量 out = 处理后的文件<br>
kkt.p &quot;out&quot;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'输出out的内容<br>
set kkt = nothing&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'销毁模板对象<br>
%&gt;<br>
<br>
执行后输出为:<br>
&lt;html&gt;&lt;title&gt;ASP模板简单替换&lt;/title&gt;&lt;body&gt;<br>
祝贺!你赢了一辆红色的法拉利!<br>
&lt;/body&gt;<br>
<br>
<br>
2)循环块演示例子<br>
模板文件myTemple2.tpl:<br>
&lt;html&gt;&lt;title&gt;ASP模板-块的演示&lt;/title&gt;&lt;body&gt;<br>
&lt;table cellspacing=&quot;2&quot; border=&quot;1&quot;&gt;&lt;tr&gt;&lt;td&gt;下面的动物您喜欢哪一种&lt;/td&gt;&lt;/tr&gt;<br>
&lt;!-- BEGIN AnimalList --&gt;<br>
&lt;tr&gt;&lt;td&gt;&lt;input type=&quot;radio&quot; name=&quot;chk&quot;&gt;{animal}&lt;/td&gt;&lt;/tr&gt;<br>
&lt;!-- END AnimalList --&gt;<br>
&lt;/table&gt;<br>
&lt;/body&gt;<br>
<br>
ASP代码:<br>
&lt;!--#INCLUDE VIRTUAL=&quot;kktTemplate.inc.asp&quot;--&gt;<br>
&lt;%<br>
dim animal, kkt, i<br>
animal = Array(&quot;小猪&quot;,&quot;小狗&quot;,&quot;小强&quot;)<br>
set kkt = new kktTemplate<br>
kkt.set_file &quot;hndKktTemp&quot;, &quot;myTemple2.tpl&quot;<br>
kkt.set_block &quot;hndKktTemp&quot;, &quot;AnimalList&quot;, &quot;list&quot;<br>
for i=0 to UBound(animal)<br>
&nbsp;&nbsp;&nbsp;&nbsp;kkt.set_var &quot;animal&quot;, animal(i), false<br>
&nbsp;&nbsp;&nbsp;&nbsp;kkt.parse &quot;list&quot;, &quot;AnimalList&quot;, true<br>
next<br>
kkt.parse &quot;out&quot;, &quot;hndKktTemp&quot;, false<br>
kkt.p &quot;out&quot;<br>
set kkt = nothing<br>
%&gt;<br>
&nbsp;&nbsp;<br>
执行结果:<br>
&lt;html&gt;&lt;title&gt;ASP模板-块的演示&lt;/title&gt;&lt;body&gt;<br>
&lt;table cellspacing=&quot;2&quot; border=&quot;1&quot;&gt;&lt;tr&gt;&lt;td&gt;下面的动物您喜欢哪一种&lt;/td&gt;&lt;/tr&gt;<br>
&lt;tr&gt;&lt;td&gt;&lt;input type=&quot;radio&quot; name=&quot;chk&quot;&gt;小猪&lt;/td&gt;&lt;/tr&gt;<br>
&lt;tr&gt;&lt;td&gt;&lt;input type=&quot;radio&quot; name=&quot;chk&quot;&gt;小狗&lt;/td&gt;&lt;/tr&gt;<br>
&lt;tr&gt;&lt;td&gt;&lt;input type=&quot;radio&quot; name=&quot;chk&quot;&gt;小强&lt;/td&gt;&lt;/tr&gt;<br>
&lt;/table&gt;<br>
&lt;/body&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>
<br>
3)嵌套块演示<br>
模板文件myTemple3.tpl:<br>
&lt;html&gt;&lt;title&gt;ASP模板-嵌套块演示&lt;/title&gt;<br>
&lt;body&gt;&lt;table width=&quot;400&quot; border=&quot;1&quot; bordercolor=&quot;#000000&quot;&gt;<br>
&nbsp;&nbsp;&lt;tr&gt;&lt;td&gt;&lt;div align=&quot;center&quot;&gt;{myname}测试&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;<br>
&nbsp;&nbsp;&lt;tr&gt;&lt;td&gt;我的动植物园:&lt;/td&gt; &lt;/tr&gt;<br>
&lt;!-- BEGIN animalList --&gt;<br>
&nbsp;&nbsp;&lt;tr&gt;&lt;td&gt;{animal}&lt;/td&gt;&lt;/tr&gt;<br>
&nbsp;&nbsp;&lt;!-- BEGIN plantList --&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&lt;tr&gt;&lt;td&gt;&amp;nbsp;&amp;nbsp;{plant}&lt;/td&gt;&lt;/tr&gt;<br>
&nbsp;&nbsp;&lt;!-- END plantList --&gt;<br>
&lt;!-- END animalList --&gt;<br>
&lt;/table&gt;<br>
&lt;/body&gt;<br>
&lt;/html&gt;<br>
<br>
ASP代码:<br>
&lt;!--#INCLUDE VIRTUAL=&quot;kktTemplate.inc.asp&quot;--&gt;<br>
&lt;%<br>
dim my_color, kkt, myname, animal, plant<br>
set kkt = new kktTemplate <br>
myname = &quot;kktTemplate block test...&quot;<br>
animal = array(&quot;动物&quot;, &quot;植物&quot;)<br>
plant&nbsp;&nbsp;= array(array(&quot;小猪&quot;,&quot;小白&quot;,&quot;小强&quot;), array(&quot;玫瑰&quot;,&quot;向日葵&quot;))<br>
<br>
kkt.set_file &quot;hndKktTemp&quot;, &quot;myTemple3.tpl&quot;<br>
kkt.set_var &quot;myname&quot;, myname, false<br>
kkt.set_block &quot;hndKktTemp&quot;, &quot;animalList&quot;, &quot;a&quot;<br>
kkt.set_block &quot;animalList&quot;, &quot;plantList&quot;, &quot;p&quot;<br>
<br>
for i=0 to UBound(animal)<br>
&nbsp;&nbsp;&nbsp;kkt.set_var &quot;animal&quot;, animal(i), False<br>
&nbsp;&nbsp;&nbsp;kkt.unset_var &quot;p&quot;&nbsp;&nbsp;<br>
&nbsp;&nbsp;&nbsp;'kkt.set_var &quot;p&quot;, &quot;&quot;, false<br>
&nbsp;&nbsp;&nbsp;for j=0 to UBound(plant(i))<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;kkt.set_var &quot;plant&quot;, plant(i)(j), false<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;kkt.parse &quot;p&quot;, &quot;plantList&quot;, true<br>
&nbsp;&nbsp;&nbsp;next<br>
&nbsp;&nbsp;&nbsp;kkt.parse &quot;a&quot;, &quot;animalList&quot;, true<br>
next<br>
kkt.parse &quot;out&quot;, &quot;hndKktTemp&quot;, false<br>
kkt.p &quot;out&quot;<br>
%&gt;<br>
<br>
执行结果:<br>
&lt;html&gt;&lt;title&gt;ASP模板-嵌套块演示&lt;/title&gt;<br>
&lt;body&gt;&lt;table width=&quot;400&quot; border=&quot;1&quot; bordercolor=&quot;#000000&quot;&gt;<br>
&nbsp;&nbsp;&lt;tr&gt;&lt;td&gt;&lt;div align=&quot;center&quot;&gt;kktTemplate block test...测试&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;<br>
&nbsp;&nbsp;&lt;tr&gt;&lt;td&gt;我的动植物园:&lt;/td&gt; &lt;/tr&gt;<br>
&nbsp;&nbsp;&lt;tr&gt;&lt;td&gt;动物&lt;/td&gt;&lt;/tr&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&lt;tr&gt;&lt;td&gt;&amp;nbsp;&amp;nbsp;小猪&lt;/td&gt;&lt;/tr&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&lt;tr&gt;&lt;td&gt;&amp;nbsp;&amp;nbsp;小白&lt;/td&gt;&lt;/tr&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&lt;tr&gt;&lt;td&gt;&amp;nbsp;&amp;nbsp;小强&lt;/td&gt;&lt;/tr&gt;<br>
&nbsp;&nbsp;&lt;tr&gt;&lt;td&gt;植物&lt;/td&gt;&lt;/tr&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&lt;tr&gt;&lt;td&gt;&amp;nbsp;&amp;nbsp;玫瑰&lt;/td&gt;&lt;/tr&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&lt;tr&gt;&lt;td&gt;&amp;nbsp;&amp;nbsp;向日葵&lt;/td&gt;&lt;/tr&gt;<br>
&lt;/table&gt;<br>
&lt;/body&gt;<br>
&lt;/html&gt;<br>
<br>
<br>
本文提及的所有代码可从此处下载:http://www.freewebs.com/kacarton/web/kktTemplate.rar(3.53K)<br>
<br>
<br>
4、小结<br>
  本文主要介绍了基于ASP利用模板类实现代码与页面分离的方法,当然还有其它更好的解决方案。本文旨在抛砖引玉各位读者、WEB开发参与进来,多提宝贵意见,多作交流,共同进步!<br>
<br>
原文:<br>
http://blog.csdn.net/nhconch/archive/2004/07/10/38683.aspx<br>
<br><br>开发者俱乐部 <a href='http://www.dev-club.com' target=_blank>http://www.dev-club.com</a><br><br><p><CENTER></center></p></td></tr></table><br></tr></td></table>
<script language=javascript >
 function doRate(){
  for (i=0;i<6;i++){
   if (document.all["Rate"+i].checked==true){
    window.location.href="rate.asp?id=26435&rateid=&RateValue=" + document.all["Rate"+i].value
    break;
   }
  }
 }
 
</script>
<TABLE WIDTH="100%" BORDER="0" CELLSPACING="1" CELLPADDING="2" ALIGN="center" BGCOLOR="#a0a0a0" ID="Table1">
<TR BGCOLOR="#f0f0f0">
<TD width=50% align=left vAlign="top">
<table width=100% BORDER="0" CELLSPACING="5" CELLPADDING="0" ID="Table2">
<tr vAlign="Top"><td><STRONG>你觉得本精华贴如何?</STRONG> 请给本精华贴打分<br><img src="images/blank.gif" width=1 height=10 ><br>
<table cellspacing="0" cellpadding="0" border="0" style="border-collapse:collapse;MARGIN-BOTTOM:12px;" ID="Table4">
<tr align="Center">
<td>&nbsp;</td>
<td>0</td>
<td>1</td>
<td>2</td>
<td>3</td>
<td>4</td>
<td>5</td>
</tr><tr align="Center">
<td>一塌糊涂&nbsp;</td>
<td><input id="Rate0" type="radio" name="RateValue" value="0" /></td>
<td><input id="Rate1" type="radio" name="RateValue" value="1" /></td>
<td><input id="Rate2" type="radio" name="RateValue" value="2" /></td>
<td><input id="Rate3" type="radio" name="RateValue" value="3" /></td>
<td><input id="Rate4" type="radio" name="RateValue" value="4" /></td>
<td><input id="Rate5" type="radio" name="RateValue" value="5" /></td>
<td>&nbsp;妙不可言</td>
</tr>
</table>    
</td></tr>
<tr>
<td>

<input class=buttonface type="button" name="btnSend" value="提交" id="Submit1" onclick="doRate()"  />
 
</td>
</tr>
</table>
</TD>

<td>
<table ID="Table3">
<tr><td>
打分结果:<BR>
  总分<STRONG>0</STRONG> 0次 </TD></TR>
  <TR>
   <TD colSpan="2">
    <TABLE id="Table5" cellSpacing="1" cellPadding="0" border="0" >
     <TR vAlign="bottom" height=30>
      <TD><IMG height="0" src="images/rtg_Bar.gif" width="12" align="bottom"></TD>
      <TD><IMG height="0" src="images/rtg_Bar.gif" width="12" align="bottom"></TD>
      <TD><IMG height="0" src="images/rtg_Bar.gif" width="12" align="bottom"></TD>
      <TD><IMG height="0" src="images/rtg_Bar.gif" width="12" align="bottom"></TD>
      <TD><IMG height="0" src="images/rtg_Bar.gif" width="12" align="bottom"></TD>
      <TD><IMG height="0" src="images/rtg_Bar.gif" width="12" align="bottom"></TD>
     </TR>
     <TR>
      <TD align="center">0</TD>
      <TD align="center">1</TD>
      <TD align="center">2</TD>
      <TD align="center">3</TD>
      <TD align="center">4</TD>
      <TD align="center">5</TD>
     </TR>
    </TABLE>
   </TD>
  </TR>
  <TR>
   <TD><STRONG>0</STRONG>人给本贴打过分</TD>
  </TR>
  </TBODY>
</table>  
</td>
</TR></table>
<img border=0 height=5 width=0 src="images/blank.gif"><br>


   <table  border="0" cellspacing="0" cellpadding="0">
     <tr>
       <td nowrap class="pagehead">相关帖子&nbsp;
       <td nowrap ><Script language="JavaScript" src="js/TextAdList.js"></script>
    <b>>></b> <font color=red><script>posttxt();</script></font>
   </td>
     </tr> 
   </table>
   <ul><li class=text9>(无)</li></ul></ul>
  <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td nowrap class=pagehead>回复这个精华帖</td>
    </tr> 
  </table>
  
 <script language="javascript">
 var bSubmit=false
 var bLoaded=false;

 function chkSubmit(){
  if (bLoaded==false)
  {
   alert("你着急提交干什么?表单还没有下载完")
   return false
  }
  if (bSubmit==false)
  {
   bSubmit=true;
   return true;
  }
  else
  {
   return false;
  }
 }
 function ABCedit(){
  if ((navigator.userAgent.indexOf("IE 4")  > -1) || (navigator.userAgent.indexOf("IE 5")  > -1))
   window.open("ABCcode/edit.htm", null, "resizable=no, height=420, width=560, status=yes, toolbar=no, menubar=no, location=no, top=0, left=0");
 }
</script>
 <form action="SaveReAnnounce.asp" method="POST" name="frmAnnounce" onsubmit="return chkSubmit()" enctype="multipart/form-data">
  <input type="hidden" name="CopyrightInfo" value="http://www.chinaasp.com">
  <input type="hidden" name="boardID" value="1">
  <input type="hidden" name="rootID" value="2376210">
  <input type="hidden" name="followup" value="2376210">
  <input type="hidden" name="boardname" value="Joy ASP">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td nowrap ><a name=#re>版面:</a></td> 
    <td  nowrap>Joy ASP</td> 
    <td width="100%"> ←<a href="list,1.htm" >返回版面</a>&nbsp;
 <Script language="JavaScript" src="js/TextAdList.js"></script>
 <b>>></b> <font color=red><script>posttxt();</script></font>
    <br>
    <img src="Images/blank.gif" width="1" height="5"></td>
  </tr>
  <tr>
   <td colspan="3" bgcolor="#730C34"><img src="Images/blank.gif" width="1" height="1"></td>  
   </tr> 
</table>
<img src="Images/blank.gif" width="1" height="5"><br> 
<img src="Images/blank.gif" width="1" height="5"><br>
  
 <table width="100%" border="0" cellspacing="2" cellpadding="0">
   <tr>
     <td width="15" >&nbsp;</td>  
     <td width="60" nowrap >用户名:</td>
     <td nowrap  WIDTH="100%">xhbmj</td>  
   </tr>
 </table> 

 

  <table width="100%" border="0" cellspacing="2" cellpadding="0">
  <tr>
    <td width="15" >&nbsp;</td>  
    <td width="60" nowrap >Email:</td>
    <td nowrap ><input name="email" type="text" size="15"></td> 
    <td nowrap ><input type="checkbox" value="use" name="replyMail"></td> 
    <td nowrap >回复请Email通知</td> 
    <td nowrap width="100%" >如果不填写则取注册Email</td>  
  </tr>
</table>
<script language="javascript">
 function changeHints(){
  var l=strlength(document.frmAnnounce.subject.value)
  if (l<=100) {
   if (document.all!=null) document.all("hints").innerHTML="还可以输入"+(100-l)+"字节"
  }
  else{
   if (document.all!=null) {
    document.all("hints").innerHTML="<font color=red>输入的字节数超出100字节</font>"
   }
  }
  return true
 }
</script>
<table width="100%" border="0" cellspacing="2" cellpadding="0">
  <tr>
    <td width="15" ><font color="red">*</font></td>  
    <td width="60" nowrap >主题:</td>
    <td nowrap ><select name=announceType>
    <option selected value=0>随便说说</option>   
    <option  value=1>原创</option>
    <option  value=2>翻译</option>
    <option  value=3>转帖</option>
    <option  value=4>灌水</option>
    <option  value=5>讨论</option>
    <option  value=6>求助</option>
    <option  value=7>公告</option>
    <option  value=8>建议</option>
    <option  value=9>调查</option>   
    </select> <input type="text" name="subject" maxlength="255" size="40" value="回复:使用模板实现ASP代码与页面分离(强烈推荐)" onKeyDown="return changeHints()" onKeyUp="return changeHints()"> (<span id="hints" >还可以输入100字节</span>)  <a href="/club/help.asp#18" target=_blank><font color=#ff3333>不能正常发言?</font></a></td>
    <td nowrap width="100%" >&nbsp;</td>  
  </tr>
  <tr>
 <td width="15" >&nbsp;</td>  
 <td width="60" nowrap >&nbsp;</td>
 <td nowrap ><font color="red">*</font> <font color=gray>如果你是要向他人求助,请把主题类型设置为“求助”</font>&nbsp;<a target=_blank href="http://www.dev-club.com/club/news.asp?about,8"><font color=red>如何在社区提问?</font></a> &nbsp;<a target=_blank href="http://www.dev-club.com/club/news.asp?about,24"><font color=green>怎么在帖子里面发布音乐、视频信息?</font></a></td>
 <td nowrap width="100%" >&nbsp;</td>
  </tr>  
</table>
<table width="100%" border="0" cellspacing="2" cellpadding="0">
  <tr>
    <td width="15" >&nbsp;</td>  
    <td nowrap >表情:</td>
    <td nowrap width="100%" >&nbsp;</td>  
  </tr></table>
<table width="100%" border="0" cellspacing="2" cellpadding="0">
  <tr>
    <td width="15" >&nbsp;</td>  
    <td ><input checked name="emote" type="radio" value="25"></td>
    <td><img src="images/emote/mood25.gif" width="20" height="20" alt border="0"></td>
    <td ><input  name="emote" type="radio" value="12"></td>
    <td><img src="images/emote/mood12.gif" width="20" height="20" alt border="0"></td> 
    <td ><input  name="emote" type="radio" value="13"></td>
    <td><img src="images/emote/mood13.gif" width="20" height="20" alt border="0"></td> 
    <td ><input  name="emote" type="radio" value="14"></td>
    <td><img src="images/emote/mood14.gif" width="20" height="20" alt border="0"></td> 
    <td ><input name="emote" type="radio" value="15"></td>
    <td><img src="images/emote/mood15.gif" width="20" height="20" alt border="0"></td> 
    <td ><input name="emote" type="radio" value="16"></td>
    <td><img src="images/emote/mood16.gif" width="20" height="20" alt border="0"></td> 
    <td ><input  name="emote" type="radio" value="17"></td>
    <td><img src="images/emote/mood17.gif" width="20" height="20" alt border="0"></td> 
    <td width="100%" >&nbsp;</td>   
  </tr>
  <tr>
    <td width="15" >&nbsp;</td>  
    <td ><input  name="emote" type="radio" value="18"></td>
    <td><img src="images/emote/mood18.gif" width="20" height="20" alt border="0"></td>
    <td ><input  name="emote" type="radio" value="19"></td>
    <td><img src="images/emote/mood19.gif" width="20" height="20" alt border="0"></td>
    <td ><input  name="emote" type="radio" value="20"></td>
    <td><img src="images/emote/mood20.gif" width="20" height="20" alt border="0"></td> 
    <td ><input  name="emote" type="radio" value="21"></td>
    <td><img src="images/emote/mood21.gif" width="20" height="20" alt border="0"></td> 
    <td ><input  name="emote" type="radio" value="22"></td>
    <td><img src="images/emote/mood22.gif" width="20" height="20" alt border="0"></td> 
    <td ><input  name="emote" type="radio" value="23"></td>
    <td><img src="images/emote/mood23.gif" width="20" height="20" alt border="0"></td> 
    <td ><input  name="emote" type="radio" value="24"></td>
    <td><img src="images/emote/mood24.gif" width="20" height="20" alt border="0"></td> 
    <td width="100%" >&nbsp;</td>   
  </tr> 
</table>
 <script>
   var lawWin
  function openLawWin(){
    lawWin=window.open("help/law.asp","lawAnnounce","height=300,width=500,resizable=no,scrollbars=yes,status=no,toolbar=no,menubar=no,location=no");
    lawWin.focus()
  }
    </script> 

<table width="100%" border="0" cellspacing="2" cellpadding="0">
  <tr>
    <td width="15" >&nbsp;</td>  
    <td nowrap >内容(最多16KB):</td>
    <td ><input type="checkbox"  value="use" name="chkSignature"></td> 
    <td nowrap >签名</td> 
    <td><img src="Images/arrow_grey_s.gif" width="6" height="7" alt border="0"></td> 
    <td nowrap ><a href="info/changeSignature.asp" class="text9">设置</a>&nbsp;&nbsp;<a href="#readFirst">发言注意事项↓</a></td>  
    <td nowrap width="100%" ><input class="buttonface" type="submit" value=" 发 送 " name=submit1 accesskey="s"> <input class="dialogbotton" type="reset" value=" 清 除 " name=reset1> ALT+S发送 </td>
  </tr>
</table>
<table width="100%" border="0" cellspacing="2" cellpadding="0">
  <tr>
    <td width="15" >&nbsp;</td>  
    <td class="BLACK9"><textarea name="body" cols="60" rows="8" ></textarea>
    <script language="JavaScript" src="Editor/edit.js"></script>
    </td>    
    <td >&nbsp;</td>   
  </tr>
</table>

<br>
<table width="100%" border="0" cellspacing="2" cellpadding="0">
  <tr>
    <td width="15" >&nbsp;</td>  
    <td width="60" nowrap >上传附件:</td>
    <td nowrap ><input type="file" name="uploadfile" style='font-size:12px'> </td>
    <td nowrap width="100%" >&nbsp;</td>  
  </tr>
   <tr>
    <td width="15" >&nbsp;</td>  
    <td width="60" nowrap >&nbsp;</td>
    <td nowrap >允许的文件类型:<font color=red>JPG<font color=#000000>,</font>GIF<font color=#000000>,</font>ZIP<font color=#000000>,</font>RAR</font>,最大不能超过<font color=red>2048</font>KB)<br>
    <img src="/club/bbs/images/pic.gif" border=0> <a href="/club/tools/imageresize.asp" target=_blank>图片缩小的工具</a>,如果您上传的JPEG图片比较大,建议您使用这个工具作尺寸调整</td>
    <td nowrap width="100%" >&nbsp;</td>  
  </tr>
</table>

<!--<br>
<table width="100%" border="0" cellspacing="2" cellpadding="0">
  <tr>
    <td width="15" >&nbsp;</td>  
    <td width="60" nowrap ><font color=red>积分大于50的人可以在本版面可以上传附件哦!</font></td>
    <td nowrap ></td>
    <td nowrap width="100%" >&nbsp;</td>  
  </tr>
</table>-->


<table width="100%" border="0" cellspacing="2" cellpadding="0">
  <tr>
    <td width="15" >&nbsp;</td>  
    <td width="60" nowrap >链接地址:</td>
    <td nowrap ><input name="url" size="40" value="http://"></td>
    <td nowrap width="100%" >&nbsp;</td>  
  </tr>
</table>
<table width="100%" border="0" cellspacing="2" cellpadding="0">
  <tr>
    <td width="15" >&nbsp;</td>  
    <td width="60" nowrap >链接标题:</td>
    <td nowrap ><input name="urlTitle" size="40" value=""></td>
    <td nowrap width="100%" >&nbsp;</td>  
  </tr>
</table>

<table width="100%" border="0" cellspacing="2" cellpadding="0">
  <tr>
    <td width="15" >&nbsp;</td>  
    <td width="60" nowrap >链接图片:</td>
    <td nowrap ><input name="urlPic" size="40" value="http://"></td>
    <td nowrap width="100%" >&nbsp;</td>  
  </tr>
</table>
<img src="images/blank.gif" height=5 width=1 border=0><br>
<a name=readFirst></a>
<table width="100%" border="0" cellspacing="2" cellpadding="0">
  <tr>
    <td nowrap width="50" valign=top align=left class="BLACK9"><B><FONT COLOR=RED>注意:</FONT></B>
    <td nowrap width="100%" class="BLACK9">
    <b>在开发者俱乐部发言之前您必须仔细阅读并同意下列条款: </b><br>
    ·尊重网上道德,遵守<a href="http://tech.sina.com.cn/i/c/65606.shtml" target="_blank">《全国人大常委会关于维护互联网安全的决定》</a>及中华人民共和国其他各项有关法律法规<br>
    ·严禁发表危害国家安全、破坏民族团结、破坏国家宗教政策、破坏社会稳定、侮辱、诽谤、教唆、淫秽等内容的作品<br>
    ·承担一切因您的行为而直接或间接导致的民事或刑事法律责任<br>
    ·开发者俱乐部各栏目的版主有权保留或删除其管辖论坛中的任意内容<br>
    ·您在开发者俱乐部发表的作品,开发者俱乐部有权在网站内免费转载或引用<br>
    <b>发言注意事项</b>:<br>
    ·带有*号的内容为必填内容<br>
    ·只有本版版主或积分大于50的人才可以帖图哦!<br>   
    ·<a target="_blank" href="help/aboutABC.asp" >怎样使用ABC代码</a>
    </td>
  </tr>
</table> 
<script>getAnnounceCookie();bLoaded=true;</script>  
 
</form>

  

<table align=center cellspacing=0 cellpadding=0 width=100% >
<tr>
 <td align=center><img src="images/blank.gif" border=0 height=4 width=1><br>
 <center><table border = 0 cellspacing=0 cellpadding = 0 align=center width=100% >
<tr><td width=468 >
    <table width=468 height=60 >
    <tr><td align=center valign=middle>

    </td></tr>
    </table>
</td>
<td width=100% >
<!--放置站内通告开始  -->
        <marquee HEIGHT=45px direction="up" scrolldelay="200" scrollamount="4" onmouseout="if (document.all!=null){this.start()}" onmouseover="if (document.all!=null){this.stop()}">
        <fieldset id=linkads><legend align="center" for=linkads><b>Dev-club通告</b></legend >
        <table><tr><td valign=top>·</td><td width=100% ><A target=_blank href="http://blog.dev-club.com/flybird/archive/2005/04/16/425.html">抗日从我做起,抵制从电器开始</A> </td></tr><tr><td valign=top>·</td><td width=100% ><A target=_blank href="http://www.dev-club.com/club/bbs/announce,2492349,1.htm"><font color=red><b>Dev-Club开始提供RSS订阅</b></font></A> </td></tr><tr><td valign=top>·</td><td width=100% ><A target=_blank href="http://blog.dev-club.com">Dev-Club博客开通,现在开通即可获得50兆文件上传空间</A> </td></tr></table>
        </fieldset>
<!--放置站内通告结束  -->       

        </marquee>
</td></tr>
</table>
</center>
 </td>
</tr>
</table>
</body>
</html>

Spring MVC3。 最近研究

  • 2012年04月18日 17:12
  • 474KB
  • 下载

记录下最近在研究的使用AndroidStudio 实现untiy3d调用安卓内置的API接口实现刷新相册的功能

项目需要截图,并刷新系统相册。使用AndroidStudio 奈何找遍国内互联网。基本都是使用eclipse的 大家都是知道得 自从出了AndroidStudio之后 ADT Bundle 就没...
  • wsevils
  • wsevils
  • 2015年12月24日 14:20
  • 1428

最近研究了一下UE4引擎就发个记录博客吧

先说说这几年比较让大家广泛使用的U3D引擎吧。 U3D引擎的优势在哪里呢? 这第一点,就是轻量级,安装方便、调试简单和打包方便 第二点,现在VR慢慢开始完善的时代,作为一款配置VR项目十分简单引擎,还...

研究了一段时间siverlight,最近需要实现一个动画,此动画是循环滚动的动画(2)

最近有点小忙,没有来得及续写,不好意思,现在完成把工作续完。 (备注此文章代码开发环境为vs2010,sl4) 先说说实现思路: 1.一个计时器:用来控制动画的循环时间的间隔(也就是一条数据循环...

最近仔细研究了一下Java的NIO以及线程并发,搞清了点思路,特作笔记如下(NIO篇)

因为前段时间的项目需要写一些高性能服务器,结果写出来的结果是五花八门,我们要求使用NIO编写异步服务器,但是竟然有人把NIO硬生生地写成同步的,还写成了一个单道批处理,线程调度、通信、同步操作,尤如天...
  • madun
  • madun
  • 2012年01月06日 18:19
  • 446

不做开发好多年,最近又研究Access了!

以下是笔记: 实验版本Access 2007 1.安全警告要打开: 否则无法运行程序. 2.VBA的菜单中,工具-> 引用->Mircosoft Acti...

我最近研究了hive的相关技术,有点心得,这里和大家分享下。

我最近研究了hive的相关技术,有点心得,这里和大家分享下。   首先我们要知道hive到底是做什么的。下面这几段文字很好的描述了hive的特性:   1.hive是基于Hadoop的一个...

关于最近研究的关键词提取keyword extraction做的笔记

之前内容的整理 要求:第一: 首先找出具有proposal性质的paper,归纳出经典的方法有哪些. 第二:我们如果想用的话,哪种更实用或者易于实现? 哪种在研究上更有意义.   第一,  ...

最近研究si47xx系列芯片

发现比较复杂,可能是因为功能比较多,参考网上的程序 发现比较乱,不过总算移植到stm32上了。这几天再仔细看下手册,优化一下程序。pcb基本完成了,中间改了好几个地方。有机会作个板子。 网上的一段简版...
  • hit97
  • hit97
  • 2012年03月30日 14:55
  • 1123

最近研究xcodebuild批量打包的一些心得

转自Rainbird的个人博客 以前的时候只知道做安卓开发的兄弟挺辛苦的,不但开发的时候要适配一堆的机型,好不容易开发完了还要打一堆不同的包给不同的市场。没想到现在这些市场都开辟iO...
  • tlb203
  • tlb203
  • 2012年10月31日 11:18
  • 32874
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:最近开始研究petshop
举报原因:
原因补充:

(最多只允许输入30个字)