' Determines if a file contains any of an array of lines.
' Case insensitive comparison.
Function DoesFileContainAnyLine(filename, lines)
Dim fs
set fs=Server.CreateObject("Scripting.FileSystemObject")
If fs.FileExists(filename) Then
set f = fs.OpenTextFile(filename, 1, true)
Do Until f.AtEndOfStream
Dim line
line = f.ReadLine
For Each needle in lines
if LCase(Trim(needle)) = LCase(Trim(line)) Then
return true
end if
Next
Loop
End If
Return False
End Function
在Return False
行上出现类型不匹配错误;为什么我不能从函数返回false?