CreateTextFile

テキスト形式でファイル作成


文法
Folderオブジェクト.CreateTextFile Name [Option] [Type]


パラメータ
Name : 作成ファイル名
Option : 上書き指定
True : 上書きする(デフォルト) / False : 上書きしない
Type : Unicode形式指定
True : Unicode / False : Ascii(デフォルト)


機能説明
テキスト形式のファイル作成
TextStreamオブジェクトを取得でき、これを設定することでファイルに書き込みができます。


使用例
<% Dim objFs, objFld, objTs, objFlCol, i Set objFs = Server.CreateObject("Scripting.FileSystemObject") Set objFld = objFs.GetFolder("D:\test\test.txt") Set objTs = objFld.CreateTextFile("test5.txt") R\objTs.WriteLine "test" objTs.Close Set objFlCol = objFld.Files Response.Write "ファイル作成後ファイルリスト<br>" & vbCrlf For Each i in objFlCol Response.Write i.Name & "<br>" & vbCrlf Next 'オブジェクトを開放 Set objTs = Nothing Set objFld = Nothing Set objFlCol = Nothing Set objFs = Nothing %>
Topへ