|
-
Jul 28th, 2008, 06:04 AM
#1
Thread Starter
Fanatic Member
[RESOLVED] winform OpenFileDialog
Hello,
The following code shows how to use the openFileDialog to read the contents of a .csv file into a textbox.
Question:
After selecting the file iin the dialog, how do I actually open the file?
remember that I would like to open the .csv file and NOT read it into the textbox.
Dim ts as StreamReader
openFileDialog1.CheckFileExists = true
openFileDialog1.CheckPathExists = true
openFileDialog1.DefaultExt = "csv"
openFileDialog1.Filter = "Text files (*.csv)|*.csv|" + "All files|*.*"
openFileDialog1.Multiselect = false
openFileDialog1.FilterIndex = 2
openFileDialog1.ValidateNames = true
if (openFileDialog1.ShowDialog() = DialogResult.OK)
ts = StreamReader(openFileDialog1.OpenFile())
txtSQL.Text = ts.ReadToEnd()
end if
Thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|