1.
You are creating a Windows application by using the .NET Framework 3.5.The application makes function calls to an unmanaged library to control the operation of a robot. You create a class that consumes significant memory during function calls to the unmanaged library. You discover that memory consumption increases over time. You need to ensure that the application consistentlyconsumes minimum memory. What should you do?
2.
5:You create a Windows application by using the .NET Framework 3.5. You plan to deploy an application by using the ClickOnce deployment method. The application has the following specifications:
* It contains multiple components.
* It is based on the .NET Framework 3.5.
* The .NET Framework 3.5 is not installed on all the client computers.
You need to install the .NET Framework 3.5 on the client computers during the application deployment process. What should you do?
3.
You are creating a Windows application by using the .NET Framework 3.5. The application connects to a database within the corporate network. It retrieves data from a read-only database. The database contains a table named Customers. An XML file that contains new customer data is periodically provided to the application. The XML file has the following specifications:
* It has the same schema as that of the Customers table.
* It will be integrated into the Customers table.
* It will be removed after data integration.
The application requires data from the Customers table and the XML file to bind to a DataGridView control. You need to ensure that data can be retrieved together from the two data sources by using minimum development effort. What should you do?
4.
You are creating a Windows application by using the .NET Framework 3.5. The application uses Microsoft SQL Server 2008 authentication to connect to a relational database. You need to devise a storage strategy for the connection string to prevent unauthorized users from accessing the information. What should you do?
5.
You create Windows Forms applications by using the .NET Framework 3.5. You plan to use the Windows Installer to deploy a new application. The application must meet the following requirements:
* Support deployment to 32-bit and 64-bit operating systems.
* Use the 64-bit Program Files folder when deployed to 64-bit platforms.
You need to ensure that the application is deployed appropriately.What should you do?
6.
You are creating a Windows Forms application that has the print functionality by using the .NET Framework 3.5. You implement the PrintPage page event for the form. You associate an instance of the PrintDocument control along with an instance of the PrintPreviewDialog control named prevDialog1. You want to set the default size of the PrintPreviewDialog class to full screen. You need to provide a print preview for the user by adding a code segment to the Click event of the button on the form. Which code segment should you use?
7.
You are creating a Windows application by using the .NET Framework 3.5. The application processes a large number of records. The records are processed on a separate thread. Occasionally, the record processing takes a long time. You add a Cancel button to the form. You also add an AutoResetEvent object on the user interface thread, and set the default value of the object to false. You plan to perform the following steps in sequence:
* After every record is processed, read the value of the AutoResetEvent object by using the AutoResetEvent.WaitOne method.
* When the value of the AutoResetEvent object is True, discontinue the record processing.
You need to modify the Click event handler of the Cancel button to change the value of the AutoResetEvent object. What should you do?
8.
You are creating a Windows application by using the .NET Framework 3.5. You plan to create a form that might result in a time-consuming operation. You use the QueueUserWorkItem method and a Label control named lblResult. You need to update the users by using the lblResult control when the process has completed the operation. Which code segment should you use?
9.
You are creating a Windows application by using the .NET Framework 3.5. The application processes a large number of records. The records are processed on a separate thread. Occasionally, the record processing takes a long time. You add a Cancel button to the form. You also add an AutoResetEvent object on the user interface thread, and set the default value of the object to false. You plan to perform the following steps in sequence:
* After every record is processed, read the value of the AutoResetEvent object by using the AutoResetEvent.WaitOne method.
* When the value of the AutoResetEvent object is True, discontinue the record processing.
You need to modify the Click event handler of the Cancel button to change the value of the AutoResetEvent object. What should you do?
10.
You are creating a Windows application by using the .NET Framework 3.5. You add a BackgroundWorker component to a Windows form to handle a time-consuming operation. You add a Cancel button to the form. You need to ensure that when the Cancel button is pressed, the background task is cancelled. What should you do?