reading a file in VB6 using file system object

Dim myFSO As Scripting.FileSystemObject
Dim myTextStream As Scripting.TextStream
Dim myString As String

Set myFSO = New Scripting.FileSystemObject

If myFSO.FileExists("filepath.txt") Then
Set myTextStream = myFSO.OpenTextFile("filepath.txt", ForReading)
myString = myTextStream.ReadAll() ' file content will be available in myString
Call myTextStream.Close
End If

Set myTextStream = Nothing
Set myFSO = Nothing

How to read / write files using activex in JavaScript

1. Reading a file

function ReadFile()
{
var FileOpener = new ActiveXObject(“Scripting.FileSystemObject”);
var FilePointer = FileOpener.OpenTextFile(“C:\abcd.txt”, 1, true);
FileContents = FilePointer.ReadAll();
alert("FileContents  " + FileContents);
FilePointer.Close();
}

2. Writing a file

function WriteFile
{
var FileOpener = new ActiveXObject(“Scripting.FileSystemObject”);
var FilePointer = FileOpener.OpenTextFile(“C:\abcd.txt”, 8, true);
FilePointer.WriteLine(“Writing first line”);
FilePointer.Close();
}