Categories

Thousands of experts bid on your personal project at ScriptLance.com

FileStream example

opening and reading a file using the FileStream with VB.net

Imports System.IO

Public Class Form1

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

Dim objStream As New IO.FileStream("d:\BOOT.txt", IO.FileMode.Open)
Dim objReader As New IO.StreamReader(objStream)
Dim strBuffer As String

strBuffer = objReader.ReadToEnd

objReader.Close()
objStream.Close()

MsgBox(strBuffer)
End Sub
End Class

No related posts.

Related posts brought to you by Yet Another Related Posts Plugin.

You must be logged in to post a comment.