microsoft visual c 2008 step by step phần 3

Nhấp vào nút / Phòng, và sau đó nhấp vào Tính toán. Các văn bản trong hộp văn bản thay đổi biểu hiện đến 54/13, và 4 giá trị xuất hiện trong hộp văn bản kết quả. Trong cuộc sống thực, 54/13 là 4,153846 định kỳ, nhưng điều này không phải là cuộc sống thực, đây là phân chia số nguyên C # thực hiện, | 108 Part I Introducing Microsoft Visual C and Microsoft Visual Studio 2008 FormatException and Exception in two different handlers which one will run or will both execute When an exception occurs the first handler found by the runtime that matches the exception is used and the others are ignored. What this means is that if you place a handler for Exception before a handler for FormatException the FormatException handler will never run. Therefore you should place more-specific catch handlers above a general catch handler after a try block. If none of the specific catch handlers matches the exception the general catch handler will. In the following exercise you will write a try block and catch an exception. Write a statement 1. Start Visual Studio 2008 if it is not already running. 2. Open the MathsOperators solution located in the Microsoft Press Visual CSharp Step By Step Chapter 6 MathsOperators folder in your Documents folder. This is a variation on the program that you first saw in Chapter 2 Working with Variables Operators and Expressions. It was used to demonstrate the different arithmetic operators. 3. On the Debug menu click Start Without Debugging. The form appears. You are now going to enter some text that is deliberately not valid in the left operand text box. This operation will demonstrate the lack of robustness in the current version of the program. 4. Type John in the left operand text box and then click Calculate. A dialog box reports an unhandled exception the text you entered in the left operand text box caused the application to fail. Microsoft Windows 3w MathsOperators has stopped working A problem caused the program to stop working correctly. Windowswill close the program and notify you if a solution is available. . Close program Note The Debug button does not appear if you are using Microsoft Visual C 2008 Express Edition. You might see a different version of this dialog box shown later depending on how you have configured problem .

Không thể tạo bản xem trước, hãy bấm tải xuống
TỪ KHÓA LIÊN QUAN
TÀI LIỆU MỚI ĐĂNG
86    89    2    28-04-2024
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.