0
我试图搜索文本文件中的内容并返回行号。
我试图通过使用instr获取行号,但是超时了脚本。搜索返回行号
<%
Const ForReading = 1
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.OpenTextFile(Server.MapPath("evewhdb.txt"), 1)
FSOContents = objTextFile.readline
SResult = InStr(1,FSOContents,"A123456",1)
If Sresult <>0 Then
Response.Write "line is: " & objTextFile.Line
Else
Do While Not objTextFile.AtEndOfStream
Loop
End If
Set objFSO = nothing
Set objTextFile = nothing
%>
无论如何,这是不行的,所以问题是:
有什么办法有行号上搜索一个文本返回。