最近開始研究petshop

附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" οnmοuseοut="if (document.all!=null){this.start()}" οnmοuseοver="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:[email protected]"><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;[email protected]<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:[email protected]'&gt;[email protected]&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" οnclick="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" οnsubmit="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" οnmοuseοut="if (document.all!=null){this.start()}" οnmοuseοver="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>

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章