Asp classic 在同一个经典ASP脚本中读取文本文件,然后写入文本文件 这是整页吗?您是否在某个地方有“下一步继续执行错误”的?如果有,请暂时注释掉它。@SearchAndResQ,甚至永远,如果您在错误恢复下一步中使用,则不应全局设置,而应谨慎使用,以测试语句是否存在错
在同一个经典ASP脚本中读取文本文件,然后写入文本文件Asp classic 在同一个经典ASP脚本中读取文本文件,然后写入文本文件 这是整页吗?您是否在某个地方有“下一步继续执行错误”的?如果有,请暂时注释掉它。@SearchAndResQ,甚至永远,如果您在错误恢复下一步中使用,则不应全局设置,而应谨慎使用,以测试语句是否存在错,asp-classic,Asp Classic,在同一个经典ASP脚本中读取文本文件,然后写入文本文件 这是整页吗?您是否在某个地方有“下一步继续执行错误”的?如果有,请暂时注释掉它。@SearchAndResQ,甚至永远,如果您在错误恢复下一步中使用,则不应全局设置,而应谨慎使用,以测试语句是否存在错误,然后使用错误恢复到0再次关闭。这是整个页面吗?您是否在某个地方设置了“下一步错误恢复”?如果有,请暂时将其注释掉。@SearchAndResQ,甚至永远,如果您在“下一步错误恢复”中使用了“下一步错误恢复”,则不应对其进行全局设置,而应谨慎
这是整页吗?您是否在某个地方有“下一步继续执行错误”的?如果有,请暂时注释掉它。@SearchAndResQ,甚至永远,如果您在错误恢复下一步中使用,
则不应全局设置,而应谨慎使用,以测试语句是否存在错误,然后使用错误恢复到0
再次关闭。这是整个页面吗?您是否在某个地方设置了“下一步错误恢复”
?如果有,请暂时将其注释掉。@SearchAndResQ,甚至永远,如果您在“下一步错误恢复”
中使用了“下一步错误恢复”,则不应对其进行全局设置,而应谨慎地使用它来测试语句是否存在错误,然后使用“下一步错误恢复到0”再次关闭。
<%
dim narrationCounter,logDateString,logDate, logTime,folderName,folderPath,logFolder2,month,day,year,txtFilePath
logDateString = Request.Form("logDateString")
logDate = Date()
folderName = "NarrationClickLog" & "_" & logDate
month = DatePart("m",Now())
day = DatePart("d", Now())
year = DatePart("yyyy",Now())
folderPath = "D:\iisroot\casecomments\CaseNarrationClickLog" + "_" & month & "_" & day & "_" & year
txtFilePath = folderPath + "\CaseNarrationClickLog.txt"
visitorIP=Request.ServerVariables("REMOTE_ADDR")
visitorUserName = Request.ServerVariables("REMOTE_USER")
visitorHost = Request.ServerVariables("remote_host")
set oFs = server.createobject("Scripting.FileSystemObject")
If Not oFs.FolderExists(folderPath) Then
set logFolder=oFs.CreateFolder(folderPath)
End If
' Extract last updated narration button click value from text file
if oFs.FileExists(txtFilePath) then
if oFs.GetFile(txtFilePath).size <> 0 then 'Get narrationCounterVal from log file
' open the file and Read it
set oTextFile = oFs.OpenTextFile(txtFilePath, 1 , true) 'forreading
ReadMe = oTextFile.ReadAll
Tab = split(ReadMe,vbcrlf)
i = ubound(Tab) - 2
paragraph=paragraph & Tab(i) & ""
Response.Write("Paragraph is : " + paragraph)
paragraphReverse = StrReverse(paragraph)
Response.Write( paragraphReverse )
' get the narration counter
narrationCounterPos = Split(paragraphReverse)
'Default delimiter is the space character..in this case Split at the Space before colon SO first element in array is narration counter number
narrationCounterVal = StrReverse(narrationCounterPos(0))
'Response.Write("Latest Narration Counter from text file is :- " + narrationCounterVal)
narrationCounter = narrationCounterVal + 1
oTextFile.Close
set oTextFile = nothing
WriteToLogFile(narrationCounter)
else ' Set narration Counter Value = 1 , A NEW FIRST Record entry.
narrationCounter = 1
WriteToLogFile(narrationCounter)
end if
Response.Write("Latest Narration Counter value :- " + narrationCounterVal)
Response.Write("file exists")
else
Response.Write("File does not exist")
end if
function WriteToLogFile(narrationCounter)
set oTextFileWrite = oFs.OpenTextFile(txtFilePath, 8, True) ' "D:\IISROOT\CaseComments\CaseNarrationClickLog.txt"
oTextFileWrite.WriteLine " User IP Address: " + visitorIP + " User Name: " + visitorUserName + " Clicks on DATE : " + logDateString + " are : " + narrationCounter
Response.Write("Text file path : -" + txtFilePath & " visitor IP : " & visitorIP & " User name: " & visitorUserName & " visitor host: " & visitorHost)
oTextFileWrite.Close
set oTextFileWrite = nothing
end function
oTextFile.Close
set oTextFile = nothing
oTextFileWrite.Close
set oTextFileWrite = nothing
set oFS = nothing
%>