123 Eng

Engineering the engineers™


Latest Jobs   Forum Map

 


Home

Source Codes

Engineering Colleges

BE Students

Training  Reports (updated)

Seminar Reports (updated

Placement Papers (updated)

Forums

   Computer Science / IT

   Electronics

   Electrical

   Mechanical

   Chemical

   Civil

   CAT / MBA

   GMAT / Foreign MBA

Latest Jobs

Engineering Jobs / Technical Jobs

Management Jobs

Sitemap

About-Us

Terms of use

Displaying  Source Code(s)  
 

 
FileRead Function

--------------------------------------------------------------------------------

Description : The FileRead function allows the contents of a file to be read. The FileRead function has one required argument, pathname, which represents the complete path to an already existing file on the server. The ReadFile function returns a string representing the contents of the file. ReadFile returns Null in the event of an error.

<%
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
%>

--------------------------------------------------------------------------------

 

Contribute content or training reports / feedback / Comments
job placement papers
All rights reserved © copyright 123ENG