File handling in VB

B

Binu C

hi am new to VB. I need to develop an application. The requirements are
as follows:

We have a notepad which consists of some data(Say A). Now we have a
form in which we have some text fields & a command button. when we
click cmd button once the data from the notepad should be read as
strings of different sizes & displayed in the text boxes. Again when we
click the cmd button the data in various text fields are written to
another notepad(say B) after creating it & again the remaining data is
read from the file A from the last position .

also i need a way to search for an unique string in notepad B from the
form & edit details around that string in file B.

Pls help me.....i need this only in VB no other scripting as i don know
about scripting.

Also if anyone can tell me link where i can get details regarding file
handling in detail in VB..i will b very helpful..
 
Z

zacks

Binu said:
hi am new to VB. I need to develop an application. The requirements are
as follows:

We have a notepad which consists of some data(Say A). Now we have a
form in which we have some text fields & a command button. when we
click cmd button once the data from the notepad should be read as
strings of different sizes & displayed in the text boxes. Again when we
click the cmd button the data in various text fields are written to
another notepad(say B) after creating it & again the remaining data is
read from the file A from the last position .

also i need a way to search for an unique string in notepad B from the
form & edit details around that string in file B.

Pls help me.....i need this only in VB no other scripting as i don know
about scripting.

Also if anyone can tell me link where i can get details regarding file
handling in detail in VB..i will b very helpful..

I would be surprised if anyone actually wrote some code for you. You
request is how to do very basic types of operations that even a
beginning program should either know or know how to figure out. I
strongly suggest spending a few days studing the help, go buy a book on
VB, and do a few Google searches for sample code.
 
J

jonathandrott

everyone has to start somewhere!

something like this should help get you started:

'reading in the first file
Dim oFile As System.IO.File
Dim oRead As System.IO.StreamReader
Dim LineIn As String
oRead = oFile.OpenText(Me.txtbox.Text) ' textbox where the file name
is
While oRead.Peek <> -1
'do what you want here
' i.e. stream writer
end while
 
C

Chris Dunaway

'reading in the first file
Dim oFile As System.IO.File
Dim oRead As System.IO.StreamReader
Dim LineIn As String
oRead = oFile.OpenText(Me.txtbox.Text) ' textbox where the file name
is
While oRead.Peek <> -1
'do what you want here
' i.e. stream writer
end while

Creating an instance of the File object is not necessary as the
OpenText method is Shared.

Dim oRead As System.IO.StreamReader
Dim LineIn As String

oRead = File.OpenText(Me.txtbox.Text)
 

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