注册 登录
编程论坛 ASP技术论坛

记录网页访问IP,输入到文本

zcnvnv 发布于 2008-09-30 16:59, 1170 次点击
代码:

<%
set fs=server.createobject("scripting.filesystemobject")
set file=fs.opentextfile("F:\小旋风AspWebServer\wwwroot\jsq.txt",2)
do while file.AtEndOfStream=true
file.skipline
loop
file.writeline(request.servervariables("REMOTE_ADDR"))
file.close
%>



错误提示:


Microsoft VBScript 运行时错误 '800a0036'

错误的文件模式

\wwwroot\jsq.asp, line 4


请问那里错了?
5 回复
#2
yms1232008-09-30 18:43
set file=fs.opentextfile("F:\小旋风AspWebServer\wwwroot\jsq.txt",2)
2这个参数可能错误了
#3
multiple19022008-09-30 19:28
object.OpenTextFile(filename[, iomode[, create[, format]]])

object
必选项。object 应为 FileSystemObject 的名称。
filename
必选项。指明要打开文件的字符串表达式。
iomode
可选项。可以是三个常数之一:ForReading 、 ForWriting 或 ForAppending 。

iomode 参数可以是下列设置中的任一种:

常数 值 描述
ForReading 1 以只读方式打开文件。不能写这个文件。
ForWriting 2 以写方式打开文件
ForAppending 8 打开文件并从文件末尾开始写。
#4
multiple19022008-09-30 19:29
https://bbs.bccn.net/thread-217957-1-1.html

遇到某些问题多看看手册就解决了。
#5
zcnvnv2008-09-30 23:12
非常感谢,祝你们好运
#6
anlige2008-10-02 01:08
用8看看~
1