473,320 Members | 2,071 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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
http://www.developmentnow.com
Nov 21 '05 #1
2 2781
Lily wrote:
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


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
Nov 21 '05 #2
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.

http://msdn.microsoft.com/library/de...classtopic.asp

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

I hope this helps

Cor
Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: simon place | last post by:
is the code below meant to produce rubbish?, i had expected an exception. f=file('readme.txt','w') f.write(' ') f.read() ( PythonWin 2.3 (#46, Jul 29 2003, 18:54:32) on win32. ) I got...
9
by: Hans-Joachim Widmaier | last post by:
Hi all. Handling files is an extremely frequent task in programming, so most programming languages have an abstraction of the basic files offered by the underlying operating system. This is...
5
by: John Douglass | last post by:
I'm fairly new to doing involved file i/o and I came across something weird with a program I'm writing (modifying MIDI data, if it makes any difference). With some input files, when I modify data...
21
by: Anthony England | last post by:
Everyone knows that global variables get re-set in an mdb when an un-handled error is encountered, but it seems that this also happens when the variable is defined as private at form-level. So...
4
by: pank7 | last post by:
hi everyone, I have a program here to test the file IO(actually output) with buffer turned on and off. What I want to see is that there will be obvious differece in time. Here I have an input...
6
by: | last post by:
Using the HttpRequest object to gather material (potentially from an external server), is it possible to write the response stream into which ever file type is required e.g. I request not just...
23
by: melon | last post by:
Hello, Is there anyway to force the application to handle the Red X button differently? I cannot use a generic Closing event as it will prevent the system to shut down properly. I hope that,...
19
by: rmr531 | last post by:
First of all I am very new to c++ so please bear with me. I am trying to create a program that keeps an inventory of items. I am trying to use a struct to store a product name, purchase price,...
0
by: Luc The Perverse | last post by:
I am designing an application which will upload files to a remote server (incidentally HTTP post if that makes any difference). This is a "client application" which, hopefully, hundreds of people...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.