TextStream オブジェクト
ファイルへのシーケンシャル アクセスを行うオブジェクトです。
TextStream.{property | method( )}
引数 property と引数 method には、TextStream オブジェクトに関連付けられている任意のプロパティおよびメソッドを指定できます。実際に使用する場合は、TextStream の部分は TextStream オブジェクトを表す変数名で置き換えることになります。TextStream オブジェクトは、FileSystemObject オブジェクトから取得します。
解説
次のコードは、変数 a が、CreateTextFile メソッドによって取得された FileSystemObject オブジェクトの TextStream オブジェクトを示す例です。
var fso = new ActiveXObject("Scripting.FileSystemObject");
var a = fso.CreateTextFile("c:\\testfile.txt", true);
a.WriteLine("テストです。");
a.Close();
[VBScript]
Dim fso, MyFile
Set fso = CreateObject("Scripting.FileSystemObject")
Set MyFile= fso.CreateTextFile("c:\testfile.txt", True)
MyFile.WriteLine("テストです。")
MyFile.Close
WriteLine および Close は、TextStream オブジェクトのメソッドです。
メソッド
Close メソッド | Read メソッド | ReadAll メソッド | ReadLine メソッド | Skip メソッド | SkipLine メソッド | Write メソッド | WriteBlankLines メソッド | WriteLine メソッド
プロパティ
AtEndOfLine プロパティ | AtEndOfStream プロパティ | Column プロパティ | Line プロパティ