Question: / / from external files 1 reference private void PopulateBoxes( ) try // Reads information form the text file StreamReader inputFile; inputFile = File. OpenText('Occasions.

/ / from external files 1 reference private void PopulateBoxes( ) try // Reads information form the text file StreamReader inputFile; inputFile = File. OpenText("'Occasions. txt") ; occasioncomboBox . Items . Clear ( ) ; while (!inputFile . EndofStream) occasioncomboBox. Items . Add (inputFile. ReadLine () ) ; / / close the file inputFile . Close( ) ; / / Select Birthday for the default item occasioncomboBox . SelectedItem - "Birthday"; inputFile = File . OpenText("'Extras. txt") ; extraslistBox. Items . Clear ( ) ; // Adds the contents of the file to the list box while ( !inputFile . EndofStream) extraslistBox. Items . Add (inputFile . ReadLine( ) ) ; catch (Exception ex) MessageBox. Show(ex. Message) ; this. Close( )
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
