Connecting Tech Pros Worldwide Forums | Help | Site Map

More Simple Questions --- Reading/Writing Files

A. Gaubatz
Guest
 
Posts: n/a
#1: Nov 21 '05
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 ***

Siva M
Guest
 
Posts: n/a
#2: Nov 21 '05

re: More Simple Questions --- Reading/Writing Files


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" <anagnos27@gmail.com> wrote in message
news:uI59GYJiFHA.3316@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 ***


Rick Mogstad
Guest
 
Posts: n/a
#3: Nov 21 '05

re: More Simple Questions --- Reading/Writing Files


http://www.google.com/search?sourcei...files%20VB.NET


Kerry Moorman
Guest
 
Posts: n/a
#4: Nov 21 '05

re: More Simple Questions --- Reading/Writing Files


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:
[color=blue]
> 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 ***
>[/color]
Armin Zingler
Guest
 
Posts: n/a
#5: Nov 21 '05

re: More Simple Questions --- Reading/Writing Files


A. Gaubatz schrieb:[color=blue]
> 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?[/color]

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

I prefer the System.IO classes.


Armin
Herfried K. Wagner [MVP]
Guest
 
Posts: n/a
#6: Nov 21 '05

re: More Simple Questions --- Reading/Writing Files


"A. Gaubatz" <anagnos27@gmail.com> schrieb:[color=blue]
> I could then use the Write/Input commands to modify/read the file. How
> do I do this in VB.NET?[/color]

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/>

Closed Thread