programming-examples/asp/FilesMaths/FileRead Function.asp
2019-11-18 14:25:58 +01:00

18 lines
454 B
Plaintext

<%
Private Function FileRead(ByVal pathname)
Dim objFSO, objFile, tmp
On Error Resume Next
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile(pathname, 1, False)
tmp = objFile.ReadAll
If Err Then
FileRead = Null
Else
FileRead = tmp
End If
objFile.Close
Set objFile = Nothing
Set objFSO = Nothing
On Error GoTo 0
End Function
%>