ASP WriteLineメソッド
完全な TextStream オブジェクトリファレンス
WriteLine メソッドは、TextStream ファイルに指定したテキストと改行文字を書き込みます。
構文
TextStreamObject.WriteLine(text)
| パラメータ | 説明 |
|---|---|
| text | オプションです。ファイルに書き込むテキスト。このパラメータを指定しない場合、改行文字がファイルに書き込まれます。 |
例
<%
dim fs,f
set fs=Server.CreateObject("Scripting.FileSystemObject")
set f=fs.CreateTextFile("c:\test.txt",true)
f.WriteLine("Hello World!")
f.WriteLine("How are you today?")
f.WriteLine("Goodbye!")
f.close
set f=nothing
set fs=nothing
%>
上記のコードを実行すると、test.txt ファイルは次のようになります:
Hello World!
How are you today?
Goodbye!
dim fs,f
set fs=Server.CreateObject("Scripting.FileSystemObject")
set f=fs.CreateTextFile("c:\test.txt",true)
f.WriteLine("Hello World!")
f.WriteLine("How are you today?")
f.WriteLine("Goodbye!")
f.close
set f=nothing
set fs=nothing
%>
上記のコードを実行すると、test.txt ファイルは次のようになります:
Hello World!
How are you today?
Goodbye!
完全な TextStream オブジェクトリファレンス その他の拡張機能