Guest_imported
New member
- Jan 1, 1970
- 0
What is the syntax in vbscript for
open for input as #1....
I want to use asp pages to output text to a file
open for input as #1....
I want to use asp pages to output text to a file
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Sub GetSourceFile()
Dim fso
'As FileSystemObject
Dim fil
'As File
Dim TxtIn
'As TextStream
Dim tmpStr
'As String
Set fso = CreateObject("Scripting.FileSystemObject")
If fso.FileExists("your_Fullpath_Filename") Then
Set fil = fso.GetFile("your_Fullpath_Filename")
Set TxtIn = fil.OpenAsTextStream(1)
'1 = open file for read
Do While Not TxtIn.AtEndOfStream
tmpStr = TxtIn.ReadLine
'Do some stuff
Loop
TxtIn.Close
End If
End Sub
Const ForReading = 1
Const ForWriting = 2
Const ForAppending = 8
<job>
<object id="fso" progid="Scripting.FileSystemObject"/>
<script language="VBScript">
Dim f
Set f = fso.CreateTextFile("c:\\testfile.txt", true)
f.WriteLine "This is a test."
f.Close
</script>
</job>