和网页制作 和ASP有关的

来源:百度知道 编辑:UC知道 时间:2024/05/18 01:31:29
我要在主页上弄个文本框,name为come。如下:
<form method="post" action="http://localhost/hmm/来访者.asp">
<div align="right"><br>
请输入你的姓名:
<input type="text" name="come" size="20" >
<input type="submit" value="提交">
</div>
</form>
我想在ASP中弄段代码来实现在文本中输入来访者的名字后,在指定位置的TXT文件中显示改名字。,下面是那个“来访者.asp”,请问我该如何写这段代码:
<html>
<head>
<title>来访者</title>
</head>

<body>

</body>
</html>
那请大侠给出好的代码,最好有注释,本人是菜鸟新手

<%
Dim come,FSO,path
come=request("come")
Set FSO=server.CreateObject("scripting.FileSystemObject")
path=server.mappath("./")
set f=FSO.OpenTextFile(path&"\comer.txt",8,true)
f.writeline(come)
f.close
Set f=Nothing
Set FSO=Nothing
%>
保存在comer.txt文件中 改代码经测试通过

1楼的可以实现,不过好象会把以前的覆盖掉.