File Handling - Difference between VB 6.0 and VB .NET???

C

Chris

Lily said:
How do you open a sequential file using OpenFile Dialog and read from it in .NET?
Also, how do you create an open file, write to it, and save it using SaveFileDialog in .NET?

I was trained using 6.0 and am unable to make the conversion to .NET.

From http://www.developmentnow.com/g/38_2005_8_0_22_0/dotnet-languages-vb.htm

Posted via DevelopmentNow.com Groups
http://www.developmentnow.com

The OpenFileDialog and SaveFileDialog don't do any of the read/writing
to/from files. All it does is give you a new UI to let the user select
the name of the file. On the OpenFileDialog object you do something like:

Dim OFD as new OpenFileDialog
OFD.ShowDialog()
MessageBox.Show(OFD.Filename)

Then you will use the FileName method open your file for reading.

Look at the StreamReader/StreamWriter class to see how to read/write
from files.

Good Luck
Chris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top