Results 1 to 3 of 3

Thread: [RESOLVED] Reading Files and Placing them in a Collection

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member neef's Avatar
    Join Date
    Dec 2001
    Location
    Boston
    Posts
    311

    [RESOLVED] Reading Files and Placing them in a Collection

    I have created football (American) play creator. When the user is satisfied with a play he has created it is saved it as a file with a .play extension. What I want to do is to cycle through all the files in a folder (probably named after the team), and place each one that has the .play extension into a CList (of ClPlay) collection.

    I have been able to successfully load one play at a time by using this code...
    Code:
                Dim fs As Stream = New FileStream(diaOpenPlay.FileName, FileMode.Open)
                Dim bf As Runtime.Serialization.Formatters.Binary.BinaryFormatter = New Runtime.Serialization.Formatters.Binary.BinaryFormatter()
                Dim Play As CLPlay
                Play = CType(bf.Deserialize(fs), CLPlay)
    ...but that was when a specific play was selected from a load dialog box. This time I want to load all the plays in a folder and store it in a collection, and I'm not sure how to modify the above code to do that.

    Thanks in advance.
    Last edited by neef; Jul 23rd, 2009 at 07:04 PM.
    Intermediate Level Programmer Extraordinaire

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