Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Data from external file

Data from external file

Scheduled Pinned Locked Moved Visual Basic
help
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    vertig0730
    wrote on last edited by
    #1

    I would like to create a external text file or .inf file to hold the list for a combobox. Any help or direction would be great. 1. Out of clutter, find simplicity. 2. From discord, find harmony. 3. In the middle of difficulty lies opportunity. Albert Einstein three rules of work

    D 1 Reply Last reply
    0
    • V vertig0730

      I would like to create a external text file or .inf file to hold the list for a combobox. Any help or direction would be great. 1. Out of clutter, find simplicity. 2. From discord, find harmony. 3. In the middle of difficulty lies opportunity. Albert Einstein three rules of work

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      You might want to check out the FileStream[^] class. There's plenty of examples. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

      V 1 Reply Last reply
      0
      • D Dave Kreskowiak

        You might want to check out the FileStream[^] class. There's plenty of examples. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

        V Offline
        V Offline
        vertig0730
        wrote on last edited by
        #3

        Thanks for the directions I did this Imports system imports system.io then in the form load Try ' Create an instance of StreamReader to read from a file. Dim sr As StreamReader = New StreamReader("MyFile.txt") Dim line1 As String ' Read and display the lines from the file until the end ' of the file is reached. Do line1 = sr.ReadLine() ComboBox3.Items.Add(line1) Loop Until line1 Is Nothing ComboBox3.Items.Add(sr) sr.Close() Catch Er As Exception ' Let the user know what went wrong. Console.WriteLine("The file could not be read:") Console.WriteLine(Er.Message) End Try 1. Out of clutter, find simplicity. 2. From discord, find harmony. 3. In the middle of difficulty lies opportunity. Albert Einstein three rules of work

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups