领导干部个人工作总结:asp生成htm详解

来源:百度文库 编辑:查人人中国名人网 时间:2024/05/03 01:29:30
我在网上看了很多资料可是没有看明白的。哪个好心的能给我一套简单的程序好使的。我能看明白的。再下感谢不已。QQ 773152
可以把你们的联系方法告诉我吗?

用FSO就可以了

<%
dim fso, file
set fso = Server.CrateObject("Scripting.FileSysteObject)
set file = fso.CreateTextFile(Server.Mappath("生成的文件名及路径"), true)
file.Write("<html>" & vbscrlf & "内容</htm>")

set file = nothing
set fso = nothing
%>

另外还,可以也做一个模板,先打读出来,再改模板。
如:
模板.htm
<html>
<head>
<title>标题1</title>
</head>
<body>
主体
</body>
</html>

ASP程序如下:
<%
dim fso, file, file1, content
set fso = Server.CrateObject("Scripting.FileSysteObject)
set file1 = fso.OpenTextFile(Server.MapPath("模板"))
content = file1.ReadAll()
set file1 = nothing
content = replace(content, "标题1", "替换内容1")
content = replace(content, "主体", "替换内容2")

set file = fso.CreateTextFile(Server.Mappath("生成的文件名及路径"), true)
file.Write(content)

set file = nothing
set fso = nothing
%>

网上有好多下载的
有:仿盛大传世网站
SKYCN入库版
都是
随意看一下了