FileSystemObject.OpentextFile() : FileSystemObject : MS JScript JAVASCRIPT TUTORIALS


JAVASCRIPT TUTORIALS » MS JScript » FileSystemObject »

 

FileSystemObject.OpentextFile()











Syntax








filesystemobject.OpentextFile(filename, iomode, create, format)



The OpentextFile() method opens a text stream object to a specified file.

The third parameter, create, is a Boolean value indicating whether the file can be created if it doesn't exist.

format, is a value indicating the format of the opened file. The default is ASCII.












<html>
    <body>
    <script language="JScript">
    <!--
    function open()
    {
        var myObject, afile;
        myObject = new ActiveXObject("Scripting.FileSystemObject");
        afile = myObject.OpenTextFile("c:\dummy.txt", ForAppending, false);
        afile.close();
    }
    -->
    </script>
    Open a text stream for the file dummy.txt

    <form name="myForm">
    <input type="Button" value="Open File" onClick='open()'>
    </form>
    </body>
    </html>







HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo MS JScript
» FileSystemObject