read file using VB Script

Status
Not open for further replies.

Xeon

Banned
Banned
42
2012
2
0
can anyone provide me with a VB Script
VB script to read the contents of a given file ??


I will add the script like this in my webpage (ISS 7 Web Server)
PHP:
<script type="text/vbscript" src="http://domain.com/file_you_will_give_me.vbs"></script>

when this vb script runs with the page .. it will diaply the contents of the file that was mentioned in the vb script



i don't want any eye candy code
 
1 comment
Not an expert but found this code:
Code:
function readFile(sPath) 
     const forReading = 1 
     dim objFSO, objFile, sData 
     set objFSO = createobject("Scripting.FileSystemObject") 
     set objFile = objFSO.openTextFile(sPath, ForReading) 
     sData = "" 
     do until objFile.atEndOfStream 
         sData = sData & objFile.readLine & vbCrLf 
     loop 
     objFile.close 
     set objFile = nothing 
     set objFSO = nothing 
     readFile = sData 
 end function
 
Status
Not open for further replies.
Back
Top