首 页  资讯中心 下载中心 资讯教程 最新下载 发布软件 发布文章 网通站 电信站繁體中文
设为首页
加入收藏
联系我们
 
您当前的位置:曾子源码软件下载站 -> 网络编程 -> ASP -> 文章内容 退出登录 用户管理
热门文章
· 常用C,VC,C++书籍下..
· 新概念英语视频教程..
· 常用 JAVA JAVA2 J..
· 《梦幻麻将馆9雀圣争..
· 新东方英语视频教程..
· 常用VB,Visual Basi..
· [组图] After Effect..
· WINDOWS 所有系统文..
· [组图] 让机器运行多..
· 全美经典学习指导系..
相关文章
· [组图] 用QQ WLM iNo..
· [组图] 比Ghost更强 ..
· 利用Session和HashT..
· [图文] ASP.Net中自定..
· [图文] ASP.Net中自定..
· [图文] ASP.Net中自定..
· [图文] 《Halo》网络..
· ASP:Hack & Anti-H..
· RedHat linux 9系统..
· IBM公司已经参与开放..
Haneng.com的简单留言板制作源程序例子
作者:不详  来源:不详  发布时间:2005-5-29 19:51:36  发布人:admin

减小字体 增大字体


default.asp
-------------------------------
<HTML><BODY BGCOLOR="#FFFFFF" TEXT="#000000">
<B>This is my guestbook. Use this form to submit your greeting:</B><BR>

<FORM METHOD="POST" ACTION="write.asp">
<INPUT NAME="new_line" TYPE="TEXT" SIZE=35>
<INPUT TYPE="SUBMIT" VALUE="Add greeting">
</FORM>
<BR><BR>
<%
  MyFile = "c:\guestbook.txt"

  'Opens the guestbook file if it exists
  Set MyFileObj=Server.CreateObject("s cripting.FileSystemObject")
  IF MyFileObj.FileExists(MyFile) THEN
    Set MyTextFile=MyFileObj.OpenTextFile(MyFile)

    'Reads a line, and outputs it
    WHILE NOT MyTextFile.AtEndOfStream
    %>
    <HR>
    <%=MyTextFile.ReadLine%>
    </HR>
    <%
    WEND

    'Closes the textfile
    MyTextFile.Close
  END IF' Does file exist
%>
<HR>
</BODY>
</HTML>

----------------------------




write.asp
----------------------------
<%
'Type in the path of the file to use. Make sure that the s cript has write access.
MyFile = "c:\guestbook.txt"

'Ready s cripting.FileSystemObject
Set MyFileObj=Server.CreateObject("s cripting.FileSystemObject")
'Opens textfile. 8 = add line to file, true = create if it doesn't exists
Set MyOutStream=MyFileObj.OpenTextFile(MyFile, 8, TRUE)

  'Writes the line to the file
  New_line = Request.Form("new_line")
  New_line = Server.HTMLEncode(New_line)
  'Adds the time and date it was posted
  New_line = "<I>Posted: " & NOW & "</I><BR>" & New_line
  MyOutStream.WriteLine(New_line)

'Closes the file
MyOutStream.Close

'Sends them back to the default page
Response.Redirect "default.asp"
%>


原作者:不详
来 源:不详


[] [返回上一页] [打 印] [收 藏]
上一篇文章:一些ASP小源程序
下一篇文章:日历源程序
∷相关文章评论∷    (评论内容只代表网友观点,与本站立场无关!) [发表评论...]
关于本站 - 网站帮助 - 广告合作 - 下载声明 - 友情连接 - 网站地图 - 网站信息排名查询
Copyright © 2004-2006 Zasp.Net. All Rights Reserved .