File handling in VB

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

    #1

    File handling in VB


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

  • zacks@construction-imaging.com

    #2
    Re: File handling in VB


    Binu C wrote:
    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.

    Comment

    • jonathandrott@gmail.com

      #3
      Re: File handling in VB

      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.Strea mReader
      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

      zacks@construct ion-imaging.com wrote:
      Binu C wrote:
      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.

      Comment

      • Chris Dunaway

        #4
        Re: File handling in VB

        jonathandrott@g mail.com wrote:
        'reading in the first file
        Dim oFile As System.IO.File
        Dim oRead As System.IO.Strea mReader
        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.Strea mReader
        Dim LineIn As String

        oRead = File.OpenText(M e.txtbox.Text)

        Comment

        Working...