ASP OpenTextFile Method
Definition and Usage
The OpenTextFile method opens the specified file and returns a TextStream object that can be used to access this file.
Syntax:
FileSystemObject.OpenTextFile(fname,mode,create,format)
Parameters | Description |
---|---|
fname | Required. The name of the file to be opened. |
mode | Optional. How to open the file.
|
create | Optional. Set whether to create a new file if the filename does not exist. True indicates that a new file can be created, while False indicates that a new file will not be created. False is the default. |
format | Optional. File format.
|
instance
<% dim fs,f set fs=Server.CreateObject("Scripting.FileSystemObject") set f=fs.OpenTextFile(Server.MapPath("testread.txt"),8,true) f.WriteLine("Αυτό το κείμενο θα προστεθεί στο τέλος του αρχείου") f.Close set f=Nothing set fs=Nothing %>