c# Final Review Questions Key and Difficult Questions

2. (Multiple choice, 9 points) In .NET, .NET Framework consists of ( ).

  • A. FCL and CLR   - development library and runtime environment
  • B. ADO.NET ASP.NET  - data manipulation and web framework
  • C. CLS and CTS  - grammar specification and type specification, that is, all languages ​​and grammar specifications and type interoperability specifications between languages
  • D. Winform and ASP.NET  - control library and web framework

Parse:

The correct answer is A. FCL and CLR. .NET Framework is a runtime environment that includes FCL (Framework Class Library) and CLR (Common Language Runtime). Among them, FCL provides practical development libraries such as commonly used types, collections, IO operations, network operations, security, and Windows GUI for applications; CLR is the core of .NET Framework and provides various supports for running .NET applications. , including garbage collection, type safety, code compilation and execution. ADON.NET , ASP.NET and Winform in options B and D are all .NET Framework application development technologies built on top of FCL . The CLS (Common Language Specification) and CTS (Common Type System) in the C option are two key standards in the .NET Framework, which stipulate what features the .NET language should have and how these features cooperate with each other.

A. The full names of FCL and CLR are:

  • FCL: Framework Class Library, that is, the .NET  Framework class library, is  the main class library provided by the .NET Framework, and contains a large number of classes and methods for developing various types of applications.
  • CLR: Common Language Runtime is  the core component of the .NET Framework, responsible for compiling the source code written in the .NET language into an intermediate language (IL), and executing and managing the intermediate language at runtime.

B. The full names of ADO.NET and ASP.NET are:

  • ADO.NET : ActiveX Data Objects .NET, is a set of data-related classes and methods for connecting, manipulating and managing data sources. ADO.NET can be used to access many types of data sources, including relational databases, XML documents, and flat files.
  • ASP.NET : Active Server Pages .NET, is a .NET  Framework-based web application framework, mainly used to build dynamic web sites, web applications and web services.

C. The full names of CLS and CTS are:

  • CLS: Common Language Specification is a specification that all languages ​​​​on the .NET platform should follow. It specifies some basic language features and behaviors to ensure interoperability between different languages.
  • CTS: Common Type System is a specification that all types on the .NET platform should follow. It specifies rules on how types are defined, stored, and exchanged to achieve type interoperability between different languages.

D. The full name of Winform is:

10. (Single-choice question, 9 points) Which of the following technologies does Net rely on to achieve cross-language interoperability? ( )

  • A. CLR
  • B. CTT
  • C. CLS
  • D. CTS

Correct answer:  C:CLS; It is easy to choose CTS by mistake

In fact, both CLS and CTS are important technologies for cross-language interoperability in the .NET Framework. Both of them have different definitions and roles. Simply put, CLS is a specification that defines the minimum requirements that cross-language assemblies must meet in order for them to be used by any .NET Framework-based programming language. CTS is a mechanism for representing types and data in .NET, and provides a common runtime environment so that cross-language programs can call and exchange data with each other.

Why is the answer to this question CLS? Because the question asks about the technology for cross-language interoperability in the .NET Framework, and CLS is the standard for cross-language interoperability in the .NET Framework. Although CTS is also an important technology, it is not the standard for cross-language interoperability in the .NET Framework. Therefore, the correct answer is C. CLS. However, it should be noted that CLS and CTS are closely related technologies in the .NET Framework, and they are often used together to achieve cross-language interoperability.

7. (Single-choice question, 9 points) It is known that the Filter property value of the OpenFileDialog control is "RTF file (*.RTF)|*.RTF | graphic file (*.BMP;*.JPG)|*.BMP;*JPG |text file (*txt)|*.txt", if you want the file type displayed in the file filter of the open dialog box to be "text file (*txt)" when the program is running, you should set its FilterIndex property value to ( ).

  • A. 4
  • B. 3
  • C. 5
  • D. 2

Correct answer:  B:3;  

The value of the Filter attribute is "RTF file (*.RTF)|*.RTF |graphic file (*.BMP;*.JPG)|*.BMP;*JPG|text file (*txt)|*.txt" from 1 start indexed

10. (True or false, 9 points) When multiple selections are allowed in the listBox control, you can use its Items property to access the selected list items.

  • A. yes
  • B. Wrong

My answer:  False Correct answer:  False

B. Wrong. In cases where multiple selections are allowed for the listBox control, the SelectedItems property should be used to access the selected list items.

As shown in the figure, there is a toolbar control in WinForms, and the Style property of the Cancel button in the figure is ( ).

  • A. DropDownButton
  • B. PushButton
  • C. ToggleButton
  • D. Separator

 Correct answer:  A:DropDownButton;

           toolStripButton2.DisplayStyle = ToolStripItemDisplayStyle.Text;
            toolStripButton2.Text = "文字";

By way of code, the

2. (Single-choice question, 9 points) In the .NET WinForms program, you can use ( ) objects to connect and access the database.

  • A. MDI
  • B. ADO.NET
  • C. JIT
  • D. System.ADO

Correct answer:  B: ADO.NET;

 The full name of ADO is ActiveX Data Objects, which is a set of object-oriented data access components for connecting and manipulating various data sources, including relational databases, text files, XML, and so on. ADO was originally intended to be used in the Microsoft Visual Basic development environment, and was later integrated into the .NET Framework and replaced by ADO.NET .

4. (Single-choice question, 9 points) In WinForms, there is a multi-document application, and three sub-windows are opened in the main form. The layout is shown in the figure. Is the layout realized by ( ) code.

  • A. this.LayoutMdi(MdiLayout.TileVertical);
  • B. this.LayoutMdi(MdiLayout.ArrangeIcons);
  • C. this.LayoutMdi(MdiLayout.Cascade);
  • D. this.LayoutMdi(MdiLayout.TileHorizontal);

My answer:  D:this.LayoutMdi(MdiLayout.TileHorizontal);; Correct answer:  D:this.LayoutMdi(MdiLayout.TileHorizontal);;

Parse:

  • C. this.LayoutMdi(MdiLayout.Cascade)

    Is a method call in the .NET WinForms application, which is used to set the multiple document interface (MDI) layout mode of the current form to cascading mode. Among them, MdiLayout is an enumerated type, which is specified as Cascade here, indicating that the cascading layout is adopted.

    In the MDI interface, if multiple sub-forms are opened at the same time, the arrangement of these sub-forms can be changed by setting different layout modes. The Cascade layout method refers to the method of arranging each sub-window sequentially from the upper left corner, and gradually expanding to the lower right corner, in which the size and position of each sub-window are determined according to the previous sub-window, forming a Layered visual effects.

  • B. this.LayoutMdi(MdiLayout.ArrangeIcons);

It is a method call in the .NET WinForms application, which is used to arrange all the subform icons of the current multiple document interface (MDI) form, so that users can view and operate more conveniently. Among them, MdiLayout is an enumeration type, which is specified as ArrangeIcons here, which means to arrange icons for MDI sub-forms.

In the MDI interface, if multiple sub-forms are opened at the same time, when these sub-forms are minimized, their corresponding icons will be displayed in the taskbar of the parent form, and the user can click the corresponding icon to switch Different interface for focus and operation. The this.LayoutMdi(MdiLayout.ArrangeIcons) method can rearrange these icons so that they can be displayed and identified more clearly and conveniently in the taskbar.

5. (Single choice, 9 points) In WinForms, in order to prevent users from closing the form unintentionally, you need to write code in the ( ) event to prompt the user whether to close the form.

  • A. Closed
  • B. VisibleChanged
  • C. Closing
  • D. Load

My answer:  C:Closing; Correct answer:  C:Closing;

In WinForms, Closed and Closing are two different events that occur when a form is closed, but have different timing and effects.

The Closed event is an event that occurs when the form has been closed and is no longer displayed. It is common to perform some final cleanup or save data etc. in this event. For example, you can release the resources occupied by the form, close the database connection, clear some cached data, and so on.

The Closing event is an event that occurs before the form is closed. At this point, some processing can be done, such as checking user input, saving unsaved data, etc., and then deciding whether to actually close the form based on the user's choice. Therefore, a confirmation dialog box usually pops up in the Closing event, prompting the user whether to close the form, in order to prevent problems such as data loss caused by misoperation. If the user selects "No", you can cancel the action to close the form.

6. (Single-choice question, 9 points) Windows applications can be divided into SDI applications and MDI applications. The following applications are not MDI applications ( ).

  • A. word
  • B. excel
  • C. Internet Explorer
  • D. notepad

Correct answer:  B: excel;

In Windows applications, an SDI (Single Document Interface) application refers to an application that can only open a single document window, while an MDI (Multiple Document Interface) application refers to an application that supports opening multiple sub-document windows in the same main window s application. Therefore, for this question, the option that is not an MDI application should be D. notepad.

A. Word supports opening multiple sub-document windows within the same main window, so it is a typical MDI application.

B. Excel also supports opening multiple sub-document windows in the same main window, so it is also an MDI application.

C. The tab page function of Internet Explorer can be regarded as opening multiple sub-document windows in the same main window, so it is also an MDI application.

D. Notepad can only open one document window, so it does not support opening multiple sub-document windows in the same main window, which belongs to the SDI application.

8. (Single-choice question, 9 points) In the menu item File, in order to set F as a mnemonic, the Text property of the menu item should be set to ( ).

  • A. %File
  • B. &File
  • C. _File
  • D. @File

My answer:  B:&File; Correct answer:  B:&File;

4. (Single-choice question, 9 points) If the FormBoderStyle of the form is set to None, then ( ).

  • A. The form has no border and cannot be resized
  • B. The form has no border but can be resized
  • C. The form has a border but cannot be resized
  • D. The form is transparent

My answer:  A: The form has no border and cannot be resized;

8. (Single-choice question, 9 points) In WinForms, it is known that there is a form named Form1. During the execution of the following code, the first event triggered is ( ) Form1 f=new Form1(); f. Activate(); f.Show(); f.Close();

  • A. Load
  • B. Activated
  • C. Closing
  • D. Closed

My answer:  A:Load;

  1. Make form f the current active window.f.Activate();

3. (Multiple choice, 9 points) GDI+ uses 3 coordinate spaces ( ).

  • A. Global coordinates, local coordinates and device coordinates
  • B. Global coordinates, window coordinates and device coordinates
  • C. Global coordinates, page coordinates and device coordinates
  • D. Global coordinates, local coordinates and physical coordinates

My answer:  C: global coordinates, page coordinates and device coordinates;

4. (Single-choice question, 9 points) The vector map consists of ( ).

  • A. Curve
  • B. Surface
  • C. Line segment
  • D. Primitives

My answer:  D: primitive;

Vector graphics are composed of a series of basic geometric primitives (such as points, line segments, curves, polygons, etc.).

5. (Single-choice question, 9 points) Which of the following controls can group other controls ( )

  • A. TextBox
  • B. GroupBox
  • C. Label
  • D. ComboBox

My answer:  B:GroupBox;

Guess you like

Origin blog.csdn.net/conquer_galaxy/article/details/130148964