Advertisement
john_oneill

Open And Display

Sep 12th, 2011
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 0.48 KB | None | 0 0
  1. Imports System.IO ' Add At The Very Top
  2.  
  3. Public Class Form1
  4.  
  5.     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  6.         Dim ofd As New OpenFileDialog
  7.         ofd.Title = "select your text file"
  8.         ofd.ShowDialog()
  9.         Dim sr As New StreamReader(ofd.FileName)
  10.         ofd.FileName = sr.ReadToEnd
  11.         Do
  12.             RichTextBox1.Text = ofd.FileName
  13.         Loop
  14.         sr.Close()
  15.     End Sub
  16. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement