帝国软件
  设为首页 加入收藏 关于我们
 
解密帝国网站管理系统
栏 目:
 
您的位置:首页 > 技术文档 > ASP编程
代码分离办法
作者:佚名 发布时间:2005-04-02 来源:不详
 

index.asp
-----------------------------------------------------------------------
<!--#include file="templateclass.asp"-->
<%
' This is the code used to load and display the template.
' See how clean it is!!! :)
sub go()
dim oTemplate

set oTemplate = new template

with oTemplate
.usetemplate("message.tpl")
.tag("date") = Date()
.tag("self") = "<div style='background:#dddddd'>" & .gettemplate("message.tpl",true) & "</div>"
.tag("aspcode") = .gettemplate("index.asp",false)
.tag("howtouse") = .gettemplate("howtouse.tpl",false)
.display()
end with

set oTemplate = nothing
end sub
go()
%>

templateclass.asp
------------------------------------------------------------------------
<%
' This is the template object. It allows the creation, reading
' and editing of templates on the server.
' CREATED BY: Christopher Brown-Floyd
' DATE: November 3, 1999
class template

' This variable stores the template
private mytemplate 'as string

' This method gets a template from the server and returns
' the whole file as a string.
public function gettemplate(pathfilename,encodetohtml) 'as string
dim oFSO 'as object
dim oTemplate 'as object
dim temptemplate 'as string

' Open type for the template(read-only)
const forreading = 1,boolcreatefile = false

if IsNull(encodetohtml) or encodetohtml = "" or encodetohtml = false then
encodetohtml = false
else
encodetohtml = true
end if

  
评论】【加入收藏夹】【 】【打印】【关闭
※ 相关链接
 ·对ASP脚本源代码进行加密  (2005-04-02)
 ·无组件文件上传代码实例  (2005-04-02)
 ·VBS、ASP代码语法加亮显示的类  (2005-04-02)
 ·一段ADSI和EXCHANGE结合的示范代  (2005-04-02)
 ·用纯ASP代码实现图片上传并存入数  (2005-04-02)
 ·用ASP代码创建EXCHANGE2000用户  (2005-04-02)
 ·ASP:6行代码实现无组件上传  (2005-04-02)
 ·PHP中如何Header出状态代码  (2005-04-02)
 ·在Windows下面从源代码编译PHP的  (2005-04-02)
 ·自动发布新闻页面的php代码  (2005-04-02)

   栏目导行
  PHP编程
  ASP编程
  ASP.NET编程
  JAVA编程
   站点最新
·致合作伙伴的欢迎信
·媒体报道
·帝国软件合作伙伴计划协议
·DiscuzX2.5会员整合通行证发布
·帝国CMS 7.0版本功能建议收集
·帝国网站管理系统2012年授权购买说
·PHPWind8.7会员整合通行证发布
·[官方插件]帝国CMS-访问统计插件
·[官方插件]帝国CMS-sitemap插件
·[官方插件]帝国CMS内容页评论AJAX分
   类别最新
·在ASP中使用数据库
·使用ASP脚本技术
·通过启动脚本来感受ASP的力量
·学习使用ASP对象和组件
·解析asp的脚本语言
·初看ASP-针对初学者
·ASP开发10条经验总结
·ASP之对象总结
·ASP与数据库应用(给初学者)
·关于学习ASP和编程的28个观点
 
关于帝国 | 广告服务 | 联系我们 | 程序开发 | 网站地图 | 留言板 帝国网站管理系统