CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    May 1999
    Posts
    4

    open and read a text file

    I have a text file with one line in it (I can also make it have one word) I need to write a VB program that will read this file every 5 seconds and based on the word inside (start or stop) execute a DDE connection. I can do the DDE part but I don’t know how to read the file, search for the word and execute the DDE commands based on the word and get it to run every 5 seconds. Any help would be great. Thanks


  2. #2
    Join Date
    Apr 2000
    Posts
    737

    Re: open and read a text file

    refer

    http://vblib.virtualave.net

    there is a function call ReadFileStr which read the content of the file into a string variable,

    hope this help.


  3. #3
    Join Date
    May 2000
    Location
    New York, NY, USA
    Posts
    2,878

    Re: open and read a text file

    Open "c:\temp\temp.txt" For Input As #1 'to read from
    Do While Not EOF(1)
    Line Input #1, sLine
    'do something with the strng sLine
    Loop
    Close #1



    Iouri Boutchkine
    [email protected]
    Iouri Boutchkine
    [email protected]

  4. #4
    Join Date
    Jul 2000
    Location
    Milano, Italy
    Posts
    7,726

    Re: open and read a text file

    Nice and swift. Of course I am already out of votes...


    Special thanks to Lothar "the Great" Haensler. Come back soon, you Guru.
    ...at present time, using mainly Net 4.0, Vs 2010



    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured