当以下代码运行时,我收到 Object Required 错误消息。可以帮忙吗,经典的 ASP 不是我的强项。
<%
Function WriteToFile(strFile, strContent)
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
' Second argument: 0 = reading, 1 = writing, 8 = appending
' Third argument: True = create file if it doesn't exist, false = dont
Set objTextFile = objFSO.OpenTextFile(strFile, 8, True)
objTextFile.Write strContent
objTextFile.Close
Set objTextFile = Nothing
Set objFSO = Nothing
End Function
Call WriteDataToFile("test.txt", "test")
%>