textBoxName.Text = System.IO.File.ReadAllText(path)
Dim ofd As New OpenFileDialog() ' declares a new openfiledialog
Dim path As String ' will be used to store the path to the file
ofd.FileName = String.Empty ' makes the filename empty to begin with
ofd.InitialDirectory = "C:\" ' wherever you want your OFD to open to
ofd.Filter = "All files(*.*)|*.*" ' used to require the file to be a certain type, specify new types in the format of Name|*.ext, separate entries with a |
If ofd.ShowDialog() = Windows.Forms.DialogResult.OK Then ' ensures the user clicked "OK"
path = ofd.FileName ' path will contain the path to the file, as well as the name of the file, as the FileName property provides these details
End If
Copyright © 2024, NextGenUpdate.
All Rights Reserved.