仓酷云

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 3458|回复: 21
打印 上一主题 下一主题

[学习教程] ASP教程之实例演示:利用ASP生成HTML文件

[复制链接]
老尸 该用户已被删除
跳转到指定楼层
楼主
发表于 2015-2-16 00:24:00 | 显示全部楼层 回帖奖励 |倒序浏览 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
想法是和程序员的想法不一样的.至于为什么.大家去想一想.跟心理学有关的生成html   共有两个页面index.htm是首页.法式对照复杂,次要是用了ASP里的文件操尴尬刁难象。
<!--index.htm---------------------->
<!DOCTYPEHTMLPUBLIC"-//W3C//DTDHTML4.01Transitional//EN"
"">
<html>
<head>
<title>UntitledDocument</title>
<metahttp-equiv="Content-Type"content="text/html;charset=gb2312">
</head>
<body>
<tablewidth="770"border="0"align="center"cellpadding="0"cellspacing="0">
<tr>
   <td><formname="form1"method="post"action="send.asp">
     <tablewidth="100%" border="0"cellpadding="0"cellspacing="0"bgcolor="#CCFFFF">
       <tr>
         <tdheight="20"><divalign="center">发送动静</div></td>
         </tr>
       <tr>
         <td><divalign="center">
           <textareaname="msg"cols="100"rows="6"></textarea>
         </div></td>
         </tr>
       <tr>
         <td><divalign="center">
             <inputtype="submit"name="Submit"value="Submit">
             <inputtype="reset"name="Submit2"value="Reset">
         </div></td>
         </tr>
     </table>
   </form></td>
</tr>
</table>
</body>
</html>
'//send.asp
<%
functionchan_time(shijian)'转换日期工夫函数
s_year=year(shijian)
iflen(s_year)=2thens_year="20"&s_year
s_month=month(shijian)
ifs_month<10thens_month="0"&s_month
s_day=day(shijian)
ifs_day<10thens_day="0"&s_day
s_hour=hour(shijian)
ifs_hour<10thens_hour="0"&s_hour
s_minute=minute(shijian)
ifs_minute<10thens_minute="0"&s_minute
chan_time=s_year&s_month&s_day&s_hour&s_minute
endfunction
functionchan_data(shijian) '转换日期工夫函数
s_year=year(shijian)
iflen(s_year)=2thens_year="20"&s_year
s_month=month(shijian)
ifs_month<10thens_month="0"&s_month
s_day=day(shijian)
ifs_day<10thens_day="0"&s_day
chan_data=s_year&s_month&s_day
endfunction
functionchan_file(shijian)'转换日期工夫函数
s_month=month(shijian)
ifs_month<10thens_month="0"&s_month
s_day=day(shijian)
ifs_day<10thens_day="0"&s_day
s_hour=hour(shijian)
ifs_hour<10thens_hour="0"&s_hour
s_minute=minute(shijian)
ifs_minute<10thens_minute="0"&s_minute
s_ss=second(shijian)
ifs_ss<10thens_ss="0"&s_ss
chan_file=s_month&s_day&s_hour&s_minute&s_ss
endfunction
top="<html><head><title>news</title></head><body>"
botom="</body></html>"
msg=request.Form("msg")
msg=replace(msg,vbcrlf,"")
msg=replace(msg,chr(9),"")
msg=replace(msg,""," ")
msg=replace(msg,"\r\n","<br>")
msg=replace(msg,"\n","<br>")
msg=top&msg&botom
Setfs=Server.CreateObject("Scripting.FileSystemObject")
all_tree2=server.mappath("news")&"\"&chan_data(now)
if(fs.FolderExists(all_tree2))then'判别明天的文件夹是不是存在
else
fs.CreateFolder(all_tree2)
endif  
pass=chan_file(now)
randomize '利用体系计时器来初始化乱数发生器
pass=rnd(pass)
pass=get_pass(pass)
pass=left(pass,10)
file1=pass
files=file1&".txt"
filez=all_tree2&"\"&files
setts=fs.createtextfile(filez,true)'写文件
forz=1tolen(msg)
  write_now=mid(msg,z,1)
  ts.write(write_now)
next
'ts.writeline(all_msg)
ts.close
setts=nothing   '文件生成
<P> iferr.number<>0orerrthen%>
  <scriptlanguage="javascript">
  alert("不克不及完成")
  </script>在实现ERP等高端的ASP应用时,用户需要提供核心的经营资料,需要ASP商有很高的信用度。楼上说交互性不好,太牵强了吧。在微软提供的一套框架中,利用asp做网站,开发效率高,使用人数少,减少不必要的开销。交互性是互动方式,是有开发人员决定的。
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|仓酷云 鄂ICP备14007578号-2

GMT+8, 2024-5-11 12:42

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表