1
JavaScript & JScript / Вывод текстового файла через JS
« : 10 Марта 2005, 14:56:41 »
This object is used to access a computer\'s file system.
Syntax:
y = new ActiveXObject("Scripting.FileSystemObject")
Example:
var fso = new ActiveXObject("Scripting.FileSystemObject");
var a = fso.CreateTextFile("c:\\file-test.txt", true);
a.WriteLine("This is a test.");
a.Close();
In the previous example, a file (file-test.txt) is created in the C drive root directory: (C:\\file-test.txt) with a short text inserted in the file (This is a test). The file is then closed and the buffer memory cleared.
Syntax:
y = new ActiveXObject("Scripting.FileSystemObject")
Example:
var fso = new ActiveXObject("Scripting.FileSystemObject");
var a = fso.CreateTextFile("c:\\file-test.txt", true);
a.WriteLine("This is a test.");
a.Close();
In the previous example, a file (file-test.txt) is created in the C drive root directory: (C:\\file-test.txt) with a short text inserted in the file (This is a test). The file is then closed and the buffer memory cleared.