您的位置:首页 > Web前端 > HTML

关于使用fso组件生成html的例子

2005-12-26 22:44 483 查看
很久没有做asp了。近来有朋友又问到了这个。其实网上例子很多。或许因为懒的去internet找,所以给他写了一个。顺便也贴上来。例子如http://www.photk.com

<%
Function writehtml(mulu,mului,messag)
  pageh=mulu
  i=mului
  msga=messag
 Set fs=Server.CreateObject("Scripting.FileSystemObject")
  all_tree2=server.mappath("stocklist")&"/"&pageh
  if (fs.FolderExists(all_tree2)) then'判断今天的文件夹是否存在
  else
    response.write all_tree2
    fs.CreateFolder(all_tree2)
  end if
  
  files=pageh&i&".html"
  filez=all_tree2&"/"&files 
  
  set ts = fs.createtextfile(filez,true)
  
  ts.write(msga)  '就是这么简单。
  ts.close
  set ts=nothing 
 
  if err.number<>0 or err then
    writehtml=0
   else writehtml=1
 end if

 set fs=nothing
End Function %>

我的例子都是给初学者看的。老鸟就不用看了。呵呵。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  html tree function internet asp