欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

ASP OpenTextFile 方法

定義和用法

OpenTextFile 方法打開指定的文件,并返回可用來訪問此文件的 TextStream 對象。

語法:

FileSystemObject.OpenTextFile(fname,mode,create,format)
參數(shù) 描述
fname 必需的。要打開的文件的名稱。
mode 可選的。如何打開文件。
  • 1=ForReading - 打開文件用于讀取數(shù)據(jù)。您無法向此文件寫數(shù)據(jù)。
  • 2=ForWriting - 打開文件用于寫數(shù)據(jù)。
  • 8=ForAppending - 打開文件,并向文件的末尾寫數(shù)據(jù)。
create 可選的。設(shè)置如果文件名不存在,是否創(chuàng)建新文件。True 指示可創(chuàng)建新文件,而 False 指示新文件不會被創(chuàng)建。False 是默認(rèn)的。
format 可選的。文件的格式。
  • 0=TristateFalse - 以 ASCII 打開文件。默認(rèn)。
  • -1=TristateTrue - 以 Unicode 打開文件。
  • -2=TristateUseDefault - 使用系統(tǒng)默認(rèn)格式打開文件。

實例

<%
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
%>