首 页 网络编程
网页制作 图形图象 操作系统 冲浪宝典
软件教学 认证考试

网络安全 网络办公 行业资讯 评测对比
您当前位置:站长天空 -> 网页制作-> CSS教程
ASP生成HTML-ASP教程,ASP技巧
作者:网友供稿 点击:8
推荐
西部数码-全国虚拟主机10强!20余项虚拟主机管理功能,全国领先!第6代双线路虚拟主机,南北访问畅通无阻!可在线rar解压,自动数据恢复设置虚拟目录等.免费赠送访问统计,企业邮局.Cn域名注册10元/年,自助建站480元起,免费试用7天,满意再付款!P4主机租用799元/月.月付免压金
站内搜索
文章页数:[1] 
<!--index.htm---------------------->
<!doctype html public "-//w3c//dtd html 4.01 transitional//en"
"http://www.w3.org/tr/html4/loose.dtd">
<html>
<head>
<title>untitled document</title>
<meta http-equiv="content-type" content="text/html; charset=gb2312">
</head>

<body>
<table width="770" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><form name="form1" method="post" action="send.asp">
<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#ccffff">
<tr>
<td height="20"><div align="center">发送消息</div></td>
</tr>
<tr>
<td><div align="center">
<textarea name="msg" cols="100" rows="6"></textarea>
</div></td>
</tr>
<tr>
<td><div align="center">
<input type="submit" name="submit" value="submit">
<input type="reset" name="submit2" value="reset">
</div></td>
</tr>
</table>
</form></td>
</tr>
</table>
</body>
</html>

//send.asp
<%
function chan_time(shijian)转换日期时间函数
s_year=year(shijian)
if len(s_year)=2 then s_year="20"&s_year
s_month=month(shijian)
if s_month<10 then s_month="0"&s_month
s_day=day(shijian)
if s_day<10 then s_day="0"&s_day
s_hour=hour(shijian)
if s_hour<10 then s_hour="0"&s_hour
s_minute=minute(shijian)
if s_minute<10 then s_minute="0"&s_minute
chan_time=s_year & s_month & s_day & s_hour & s_minute
end function

function chan_data(shijian) 转换日期时间函数
s_year=year(shijian)
if len(s_year)=2 then s_year="20"&s_year
s_month=month(shijian)
if s_month<10 then s_month="0"&s_month
s_day=day(shijian)
if s_day<10 then s_day="0"&s_day
chan_data=s_year & s_month & s_day
end function
function chan_file(shijian)转换日期时间函数
s_month=month(shijian)
if s_month<10 then s_month="0"&s_month
s_day=day(shijian)
if s_day<10 then s_day="0"&s_day
s_hour=hour(shijian)
if s_hour<10 then s_hour="0"&s_hour
s_minute=minute(shijian)
if s_minute<10 then s_minute="0"&s_minute
s_ss=second(shijian)
if s_ss<10 then s_ss="0"&s_ss
chan_file = s_month & s_day & s_hour & s_minute & s_ss
end function
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," ","&nbsp;")
msg=replace(msg,"\r\n","<br>")
msg=replace(msg,"\n","<br>")
msg=top&msg&botom
set fs=server.createobject("scripting.filesystemobject")
all_tree2=server.mappath("news")&"\"&chan_data(now)
if (fs.folderexists(all_tree2)) then判断今天的文件夹是否存在
else
fs.createfolder(all_tree2)
end if
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

set ts = fs.createtextfile(filez,true) 写文件
for z=1 to len(msg)
write_now=mid(msg,z,1)
ts.write(write_now)
next
ts.writeline(all_msg)
ts.close
set ts=nothing 文件生成

if err.number<>0 or err then%>
<script language="javascript">
alert("不能完成")
</script>
<%else%>
<script language="javascript">
alert("已完成")
history.back();
</script>
<%end if
set myfile = fs.getfile(filez)
all_tree2=server.mappath("news")&"\"&chan_data(now)
if (fs.folderexists(all_tree2)) then
else
fs.createfolder(all_tree2)
end if
myfile.name= left(myfile.name,len(myfile.name)-4)&".htm"
set myfile=nothing
set fs=nothing
set fdir=nothing
function get_pass(pass)

pass=cstr(pass)
pass=replace(pass," ","")
pass=replace(pass," ","")
pass=replace(pass,"-","")
pass=replace(pass," ","")
pass=replace(pass,":","")
pass=replace(pass,".","")
pass=replace(pass,"+","")
pass=replace(pass,"_","")
pass=replace(pass,"<","")
pass=replace(pass,">","")
pass=replace(pass,"!","")
pass=replace(pass,"@","")
pass=replace(pass,"#","")
pass=replace(pass,"$","")
pass=replace(pass,"%","")
pass=replace(pass,"^","")
pass=replace(pass,"&","")
pass=replace(pass,"*","")
pass=replace(pass,"(","")
pass=replace(pass,")","")
pass=replace(pass,"=","")
pass=replace(pass,"\","")
pass=replace(pass,"/","")
pass=replace(pass,"|","")
get_pass=pass

end function
%>
文章整理:站长天空 网址:http://www.z6688.com/
以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!

文章页数:[1] 


放大字体显示 缩小字体显示 打印文章 推荐给朋友
热门文章
·ASP.NET with C#使用md5,sha1加密初探-.NET教程,Asp.Net开发
·最简单的java分页算法-JSP教程,Java技巧及代码
·创建ASP.NET WEB自定义控件——例程1-.NET教程,Asp.Net开发
·探究客户端浏览器分辨率的自适应问题(1)-.NET教程,评论及其它
·基于.net开发平台项目案例集锦-.NET教程,Asp.Net开发
·编程初学者的良言警句-ASP教程,脚本编码
·Java中for循环中执行顺序问题及break, continue用法-JSP教程,Java技巧及代码
·Java数据库编程中的几个常用技巧-JSP教程,数据库相关
·ASP.NET2.0中的ClientScriptManager 类用法—如何添加客户端事件-.NET教程,评论及其它
·如何查找、删除表中重复的记录-数据库专栏,SQL Server
最新文章
·google adwords投放报告(二)_网赚技巧
·专访帝国软件的创造者:仍然在路上的80后_站长访谈
·王微:视频网站还要烧钱3年_站长访谈
·个人经验:做站的几大忌讳_站长心得
·大鸟的草根站长seo技巧(一)_站长心得
·flash与后台编码兼容性问题的解决方案_flash教程
·怎样才能把自己的网站做好?一定要知道的定律_站长心得
·论网站设计的十大要点2_站长心得
·网页设计配色应用实例剖析——橙色系2_站长心得
·被k的网站如何改进重新申请通过_google推广
相关主题
  • ASP生成XBM图可用作验证码-ASP教程,ASP应用
  • ASP生成静态网页的方法-ASP教程,ASP应用
  • ASP生成静态页面的方法-ASP教程,ASP应用
  • ASP生成静态网页,学习CASE的用法,以及“权限”的一种控制方法-ASP教程,组件开发
  • ASP生成静态htm页面基本代码!-ASP教程,ASP基础
  • 西部数码虚拟主机

    友情链接
    CNNIC 西部数码
    万网 自助建站
    虚拟主机 asp空间
    域名注册 域名
    域名申请 主页空间
    论坛空间 网站空间
    国际域名 虚拟空间
    空间租用 DDOS防火墙
    成都主机托管 四川主机托管
    主机租用 服务器租用
    网站目录 自助建站
    虚拟主机 网址大全
    软件下载
    自助链接
    虚拟主机资讯 特价虚拟主机
    版权申明:本站文章均来自网络,如有侵权,请联系我们,我们收到后立即删除,谢谢!
    关于我们:站长天空:专业提供最新的站长资讯、在线教程、虚拟主机权威评测、虚拟主机性能对比、网站制作教程,开发教程,站长工具。包括网页制作教程、冲浪宝典、编程参考、操作系统、软件教学、行业动态等。
    特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有。
    发表评论 打印  刷新     关闭