Reference no: EM13308368
Your mission: Write a Windows application that gets names and e-mail addresses from the user and displays a list of all of the user's contacts. Each time the user enters a new contact, he/she should able to see it added to a list of previously stored contacts. For example, in the following sample output below, after the user clicks the "Add Contact" button, the list will include John Mann's contact information at the bottom.
Note: Make sure to first create a .txt file in your project's bin/Debug folder to hold the contact info.
When designing the GUI, consider initially disabling the e-mail textbox and the button until all information is entered. Redisable them when the button is clicked. Note that you can also use the Tab Index property of GUI objects to set their order of use.
Pseudocode:
When the "Add Contact" button is clicked
Open an output file stream for appending
Write the contact's name and e-mail address to the file
Close the file stream
Clear the list
Open an input file stream for reading
Add each line of the file to the list
Close the file stream
When the form closes Close the input and output file streams