Head A C # Chinese version chapter II Page57

Source: Internet
Author: User
Tags contact form

How's it going? Now your program does not display the contact form, it only pops up the message box window. You write a new main () method, and you give the program a new entry point. The first thing the program does now is run the instruction in main--that is, run MessageBox.Show (). There is no other instruction in main except this one, so when you click on the OK button, the program does not have a command to execute, it will stop.

5 Think about how to fix your program so that it can also eject the contact window.

Q: What are braces for?

A: C # uses curly braces to organize instructions into blocks of code. Curly braces are always in pairs. You can always see a closing parenthesis after an opening parenthesis. The IDE matches the braces--click on a bracket, its pair bracket and it will be shaded.

Q: I don't know what the entry point is. Can you explain it to me again?

A: The program has a lot of instructions. But they are not executed together. The program starts with the first instruction, then the next, next, next, and so on. These instructions are usually organized into classes, how does the program know where to start? That's how the entry point came in. The compiler cannot compile your code unless there is an entry point called the main () method. The program begins execution from the first instruction in the main () method.

Q: How did I get an error in the Error list while I was running? I think only the "build solution" is going to be like that.

A: Because the first thing that happens when you run a program is to save all the files in the solution and try to compile them. At compile time--whether it is run or build--if there is an error, the IDE displays the error in the Error list without running the program.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.