FileStream example

November 27, 2008 by admin  
Filed under VB.net

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

Related posts:

  1. display the html of a web page This example will display the html source of a given...
  2. change drive name Private Declare Function SetVolumeLabelA Lib “kernel32″ _ (ByVal lpRootPathName As...
  3. Screen capture Screen capture using Visual Basic Private Declare Sub keybd_event Lib...
  4. change windows wallpaper Declare Function SystemParametersInfo Lib “user32″ Alias “SystemParametersInfoA” (ByVal uAction As...
  5. Simple PHP counter This is a simple counter example with PHP, this example...

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

Speak Your Mind

Tell us what you're thinking...
and oh, if you want a pic to show with your comment, go get a gravatar!