ASP Crazy 模版操作类(最简单的模板类、仅提供交流(2)
'写入网页内容
htmlwrite.WriteLine FileData
htmlwrite.Close
set htmlwrite=Nothing
End Sub
End Class
%>
用法示例:
index.asp
复制代码 代码如下:
<!--#include file="Awa_temp.Class.asp"-->
<%
Set awa=New AwaTemp
With awa
.Temp="temp.tpl"
.ReadTemp
.Label="{tl1}"
.LValues="蛋疼"
.Rep
.Echo
'.HtmlName="aa/index.html"
'.GetHtml
End With
Set awa=nothing
%>
模版
temp.tpl:
复制代码 代码如下:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<body>
<table width="200" border="1">
<tr>
<td>{tl1}</td>
<td>{tl2}</td>
<td>{tl3}</td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
</body>
</html>