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

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Lily

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

    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_2...nguages-vb.htm

    Posted via DevelopmentNow. com Groups
    DevelopmentNow is an award-winning creative software development agency integrating mobile, web, hardware, mixed reality, and emerging technology.

  • Chris

    #2
    Re: File Handling - Difference between VB 6.0 and VB .NET???

    Lily wrote:[color=blue]
    > 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_2...nguages-vb.htm
    >
    > Posted via DevelopmentNow. com Groups
    > http://www.developmentnow.com[/color]

    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

    Comment

    • Cor Ligthert [MVP]

      #3
      Re: File Handling - Difference between VB 6.0 and VB .NET???

      Lily or Jody or whatever

      In addition to Chris, if you got the file, than in the streamreader and
      streamwriter classes on MSDN are (in a table) links to a lot of samples
      given how to handle your problem.



      Although it is possible, do I never the classic VB6 file handling methods
      because they are less descritive.

      I hope this helps

      Cor


      Comment

      Working...