CreateTextFile 的小问题
<%
CountFile=server.MapPath("txtcounter.txt")
set FileObject=server.CreateObject("Scripting.FileSystemObject")
我写了一个与页面分离的计数器的小asp脚本。可出现一个小问题,望指点一二:
代码如下:
count.asp
-----------------------------------
set Out=FileObject.OpenTextFile(CountFile,1,FALSE,FALSE)
counnter=Out.ReadLine
Out.Close
set FileObject=Server.CreateObject("Scripting.FileSystemObject")
set Out=FileObject.CreateTextFile(CountFile,1,TRUE,FALSE)
Application.Lock
counter= counter+1
Out.WriteLine(counter)
Application.UnLock
Response.Write"document.write("&counter&")"
Out.Close
%>
-----------------------------------------------------------------
用interdev调试跳出如下错误信息:
an exception of type 'Microsoft VBScript 运行时错误:错误的参数个数或无效的参数属性值:
'FileObject.CreateTextFile'was not handled.