Skip to content
WJunction - Webmaster Forum

read file using VB Script

Status
Not open for further replies.
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.

About the author

X
Banned · Joined
42
Messages
2
Reactions
8
Points

Advertise on WJunction

Reach 1000's of webmasters, hosts & affiliates. Banner & sponsored-thread slots available.

Contact us
Back
Top Bottom