<%@ Page Language="VB" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)

' Opens a file and returns a FileStream
Dim fs As System.IO.FileStream = _
    System.IO.File.Open("C:\Wrox\temp.txt", System.IO.FileMode.Open)


' Opens a file and returns a StreamReader for reading the data
Dim sr As System.IO.StreamReader = System.IO.File.OpenText("C:\Wrox\temp.txt")


' Opens a filestream for reading
        'Dim fs As System.IO.FileStream = System.IO.File.OpenRead("C:\Wrox\temp.txt")


' Opens a filestream for writing 
        'Dim fs As System.IO.FileStream = System.IO.File.OpenWrite("C:\Wrox\temp.txt")


' Reads the entire file and returns a string of data
Dim data As String = System.IO.File.ReadAllText("C:\Wrox\temp.txt")


' Writes the string of data to the file 
System.IO.File.WriteAllText("C:\Wrox\temp.txt", data) 

End Sub
</script>