? FileSystemObject.OpenTextFile(fname,mode,create,format)
arameter參數(shù) | Description描述 |
---|---|
fname | Required. The name of the file to open 必要參數(shù)。指定需要打開文件的名稱 |
mode | Optional. How to open the file? 可選組件。規(guī)定打開文件的方式 1=ForReading - Open a file for reading. You cannot write to this file. |
create | Optional. Sets whether a new file can be created if the filename does not exist. True indicates that a new file can be created, and False indicates that a new file will not be created. False is default 可選組件。設(shè)置是否可以建立一個原本不存在的新文件。如果為true真,則可以建立一個新的文件,如果為false假,則不可以建立一個新的文件。默認情況是false假。 |
format | Optional. The format of the file? 可選組件。規(guī)定文件的格式 0=TristateFalse - Open the file as ASCII. This is default. |
<% dim fs,f set fs=Server.CreateObject("Scripting.FileSystemObject") set f=fs.OpenTextFile(Server.MapPath("testread.txt"),8,true) f.WriteLine("This text will be added to the end of file") f.Close set f=Nothing set fs=Nothing %>
發(fā)表評論