PasswordCreator/PasswordInformation.cs
/// <summary>
/// Load the password entity from a file
/// </summary>
Load the password entity from a file
Load the password entity from a file
public void Load()
        {
            if (File.Exists(DATE_FILENAME))
            {
                try
                {
                    FileStream readerFileStream = new FileStream(DATE_FILENAME, FileMode.Open, FileAccess.Read);
                    this.passwordDictionary = (Dictionary<string, PasswordEntity>)
                        this.formatter.Deserialize(readerFileStream);
                    readerFileStream.Close();
                }
                catch (Exception)
                {
                    MessageBox.Show("Cannot read Password Information file!");
                }
            }
        }
public void Load ( ) { if ( File . Exists ( DATE_FILENAME ) ) { try { FileStream readerFileStream = new FileStream ( DATE_FILENAME , FileMode . Open , FileAccess . Read ) ; this . passwordDictionary = ( Dictionary < string , PasswordEntity > ) this . formatter . Deserialize ( readerFileStream ) ; readerFileStream . Close ( ) ; } catch ( Exception ) { MessageBox . Show ( " " ) ; } } }
Load the password entity from a file
Load the password entity from a file
//opens the file to read from //reconstruct password Entities from the file //close the file stream