Create an application that stores people's names and birthdays in a file (Fig. 23.40). The user creates a file and inputs each person's first name, lastname and birthday on the Form. The information is then written to the file.
a) Copying the template to your working directory. Copy the directory C: ExamplesTutorial23ExercisesBirthdaySaver to your C: SimplyVB2008 directory.
b) Opening the application's template file. Double click BirthdaySaver.sln in the
BirthdaySaver directory to open the application (Fig. 23.40).
c) Adding and customizing an OpenFileDialog component. Add an OpenFile Dialog component to the Form. Change its Name property to openFileDialog. Set the CheckFileExists property to False.
d) Importing namespace System. IO. Import System. IO to allow file processing.
e) Declaring a StreamWriter object. Declare a StreamWriter object that can be used throughout the entire class.
f) Defining the Open File... Button's Click event handler. Double click the Open File... Button to create the openButton_Click event handler. Write code to display the Open dialog. If the user clicks the Cancel Button in the dialog, the event handler performs no further actions. Otherwise, determine whether the user provided a file name that ends with the . txt extension. If not, display a MessageBox asking the user to select an appropriate file. If the user specified a valid file name, perform Step g.
g) Initializing the StreamWriter. Initialize the StreamWriter in the event handler openButton_Click, passing the user-input file name as an argument. Allow the user to append information to the file by passing the Boolean value True as the second argument to the StreamWriter. Enable the Enter and Close File Buttons. Disable the Open File... Button.
h) Defining the Enter Button's Click event handler. Double click the Enter Button to create the event handler enterButton_Click. This event handler writes the name of the person and the person's birthday on a line in the file. Finally, the TextBoxes on the Form are cleared, and the DateTimePicker's value is set back to the current date.
i) Defining the Close File Button's Click event handler. Double click the Close FileButton to create the closeButton_Click event handler. Close the StreamWriter connection and reset the Buttons to their initial state in this event handler.
j) Running the application. Select Debug > Start Debugging to run your application.
Open a file by clicking the Open File... Button. After a file has been opened, use the input fields provided to enter birthday information. After each person's name and birthday are typed in, click the Enter Button. When you are finished, close the file by clicking the Close File Button. Browse to the file and ensure that its contents contain the birthday information that you entered.
k) Closing the application. Close your running application by clicking its close box.
l) Closing the IDE. Close the Visual Basic IDE by clicking its close box.© BrainMass Inc. brainmass.com October 16, 2018, 7:47 pm ad1c9bdddf
The expert creates an application that stores people's names and birthdays in a file.
Fundamentals of Business Law & Electronic Contracting
E-commerce is growing by leaps and bounds, propelling business further into the information age with each passing day. People just like you and me clicked our mouse and purchased approximately $10 billion in merchandise during 1999. The U. S. Department of Commerce forecasts Internet retailing will exceed $50 billion within the next two years, and business-to-business e-commerce will top $1 trillion. With millions of transaction taking place, it is inevitable that contract disputes will arise, and common rules to authenticate and confirm the integrity of electronic documents and their signers are of paramount importance.
On September 16, 1999, Governor Gray Davis signed Senate Bill 820 making California the first state to adopt an electronic contracting law. The law went into effect January 1, 2000. Its primary purpose is to "ensure that electronic contracts (records and signatures) have the same legal effect as their hardcopy counterparts." In addition, the law legalizes electronic signatures and even extending the electronic signature, under certain circumstances, to satisfy requirements that a signature be notarized. The law, however, only applies to transactions where the contracting parties have agreed in advance to be bound by an electronic transaction.
Maybe the law's most extreme fault is that it fails to cover all transactions. The following contracts are excluded:
Wills, codicils, and testamentary trusts.
Certain transactions governed by various consumer protection laws (for example, notice of mortgage late fees, non-judicial foreclosure notices, and statements of finance charges).
Any transaction under the Automobile Sales Finance Act or the Vehicle Licensing Act.
Some retail installment sales contracts.
Even with these shortcomings, the law undoubtedly will have a significant effect on the future of contract law in California and the nation. Exactly what that effect will be, however, remains to be decided in the courtroom. In the following section, we will examine some of the issues.
What will be the long-term impact of electronic contracting on the nation's business?
What are the potential pitfalls you see with electronic contracting?View Full Posting Details