473,396 Members | 1,780 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,396 software developers and data experts.

More Simple Questions --- Reading/Writing Files

In VB6, I would open files with:

Open <file name> For <input/output/append> As <file number>

I could then use the Write/Input commands to modify/read the file. How
do I do this in VB.NET?

Thanks

*** Sent via Developersdex http://www.developersdex.com ***
Nov 21 '05 #1
5 1221
Use System.IO namespace types. A sample is here
http://www.startvbdotnet.com/files/default.aspx

Also check out MSDN for more samples.

"A. Gaubatz" <an*******@gmail.com> wrote in message
news:uI**************@TK2MSFTNGP14.phx.gbl...
In VB6, I would open files with:

Open <file name> For <input/output/append> As <file number>

I could then use the Write/Input commands to modify/read the file. How
do I do this in VB.NET?

Thanks

*** Sent via Developersdex http://www.developersdex.com ***
Nov 21 '05 #2
A.,

Those VB6 techniques will still work in VB.Net, with a few minor changes.

For example, instead of Open, use FileOpen.

VB.Net can also use the classes in the System.IO namespace.

Kerry Moorman
"A. Gaubatz" wrote:
In VB6, I would open files with:

Open <file name> For <input/output/append> As <file number>

I could then use the Write/Input commands to modify/read the file. How
do I do this in VB.NET?

Thanks

*** Sent via Developersdex http://www.developersdex.com ***

Nov 21 '05 #4
A. Gaubatz schrieb:
In VB6, I would open files with:

Open <file name> For <input/output/append> As <file number>

I could then use the Write/Input commands to modify/read the file. How
do I do this in VB.NET?


Part of VB.Net docs:
http://msdn.microsoft.com/library/en...Processing.asp

I prefer the System.IO classes.
Armin
Nov 21 '05 #5
"A. Gaubatz" <an*******@gmail.com> schrieb:
I could then use the Write/Input commands to modify/read the file. How
do I do this in VB.NET?


File Access with Visual Basic Run-Time Functions:

Visual Basic Language Concepts -- File Access with Visual Basic Run-Time
Functions
<URL:http://msdn.microsoft.com/library/en-us/vbcn7/html/vbconProcessingFiles.asp>

- or -

..NET Framework Class Library -- 'FileStream' Class
<URL:http://msdn.microsoft.com/library/en-us/cpref/html/frlrfSystemIOFileStreamClassTopic.asp>

..NET Framework Class Library -- 'StreamWriter' Class
<URL:http://msdn.microsoft.com/library/en-us/cpref/html/frlrfsystemiostreamwriterclasstopic.asp>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #6

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

Similar topics

303
by: mike420 | last post by:
In the context of LATEX, some Pythonista asked what the big successes of Lisp were. I think there were at least three *big* successes. a. orbitz.com web site uses Lisp for algorithms, etc. b....
7
by: dan | last post by:
hey peeps, i am completely new at c++ and i need some help with an assignment. it is basically about file i/o with fstreams. i understand how to open a file with fstream, but how would you read,...
116
by: Mike MacSween | last post by:
S**t for brains strikes again! Why did I do that? When I met the clients and at some point they vaguely asked whether eventually would it be possible to have some people who could read the data...
44
by: Neil Cerutti | last post by:
In Rob Pike's style guide he urges the following: Simple rule: include files should never include include files. If instead they state (in comments or implicitly) what files they need...
6
by: KevinD | last post by:
assumption: I am new to C and old to COBOL I have been reading a lot (self teaching) but something is not sinking in with respect to reading a simple file - one record at a time. Using C, I am...
26
by: Lasse Edsvik | last post by:
Hello I'm trying to build a simple COM+ app in vs.net using C# and i cant register it in component manager..... what more is needed than this: using System; using...
2
by: Suzanne | last post by:
Hi all, I'm reposting this message as I'm experiencing this problem more and more frequently : I really hope someone out there can help me as I've been tearing my hair out on this one for a...
2
by: Hexman | last post by:
Hello All, Well I'm stumped once more. Need some help. Writing a simple select and update program using VB.Net 2005 and an Access DB. I'm using parameters in my update statement and when trying...
8
by: STG | last post by:
Greetings, My group has an SDK that was developed 5 years ago with VC++ 6. Over the last years, the requests for a VS.NET SDK has reached critical mass and I am now in the process of doing that....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.