Which two actions should you take Each correct answer presents part of the solution Choose two

A. Use XCOPY to install the assembly in the global assembly cache.

B. Use XCOPY to install the assembly in the Windows\Assembly folder.

C. Create a strong name for the assembly.

D. Recompile the assembly by using the Native Image Generator (Ngen.exe).

E. Modify the application configuration file to include the assembly.

F. Use a deployment project to install the assembly in the global assembly cache.

G. Use a deployment project to install the assembly in the Windows\System32 folder.

Answer: C, F Explanation:

The global assembly cache stores assemblies specifically designated to be shared by several applications on the computer.

C: An assembly must have a strong name to be installed in the global assembly cache. F: There are two ways to install an assembly into the global assembly cache:

• Using Microsoft Windows Installer 2.0. This could be achieved by a deployment project.

• Using the Global Assembly Cache tool (Gacutil.exe). This is not an option here.

Reference:

.NET Framework Developer's Guide, Working with Assemblies and the Global Assembly Cache .NET Framework Developer's Guide, Installing an Assembly into the Global Assembly Cache

QUESTION NO: 20

You use Visual Studio .NET to develop a Windows-Bases application named PatTrac. It uses the security class libraries of the .NET Framework to implement security. PatTrac will run within the context of a Windows 2000 domain named MedicalOffice. Calls to a remote Windows 2000 domain named TestKing will occur during the execution of PatTrac.

You want PatTrac to log on to the TestKing domain by using a generic user account. What should you do?

A. Create a new instance of the WindowsImpersonationContext class by calling the Impersonate method of the Genericidentity object and passing the token of the user whom you want to impersonate.

B. Create a new instance of the WindowsImpersonationContext class by calling the Impersonate method of the WindowsIdentify object and passing the token of the user whom you want to impersonate.

C. Create a new instance of the ZoneIdentifyPermission class by calling the Impersonate method of the GenericPrincipal object and passing the token of the user whom you want to impersonate.

D. Create a new instance of the ZoneIdentifyPermission class by calling the Impersonate method of the WindowsPrincipal object and passing the token of the user whom you want to impersonate.

Answer: B

Explanation: We must impersonate another user. The WindowsImpersonationContext Class, not ZoneIdentifyPermission class, should be used. Furthermore the Impersonate method must be used on a Windowsidentity object, not on a Genericidentity object.

Reference: .NET Framework Class Library, WindowsImpersonationContext Class [Visual Basic]

QUESTION NO: 21

You use Visual Basic .NET to develop a Windows-based application. You plan to reuse a procedure written in Visual Basic 6.0. The procedure includes the following array declaration:

Dim Employees(1 to 10) As String

You copy and paste the array declaration from the Visual Basic 6.0 project into the new Visual Basic .NET project. Now you must ensure that the Employees array will compile in the Visual Basic .NET application. What should you do?

A. Include the Option Base 1 statement in the Declaration section of the module.

B. Include the Option Base 0 statement in the Declaration section of the module.

C. Replace the Dim statement with the following code segment:

Dim Employees(0 to 9) As String

D. Replace the Dim statement with the following code segment: Dim Employees(9) As String

E. After the Dim statement, add the following code segment: ReDim Employees(0 to 9) As String

F. After the Dim statement, add the following code segment: ReDim Employees(9) As String

Answer: D

Explanation: Array lower bounds is supported in Visual Basic 6.0, but not in Visual Basic .Net. Reference: Visual Basic Language Reference, Dim Statement

QUESTION NO: 22

You develop a Windows Form that provides online help for users. You want the help functionality to be available when users press the F1 key. Help text will be displayed in a pop-up window for the text box that has focus.

To implement this functionality, you need to call a method of the HelpProvider control and pass the text box and the help text.

Which method should you call?

A. SetShowHelp

B. SetHelpString

C. SetHelpKeyword

D. ToString

Answer: B Explanation:

To associate a specific Help string with another control, use the SetHelpString method. The string that you associate with a control using this method is displayed in a pop-up window when the user presses the F1 key while the control has focus.

Reference: Visual Basic and Visual C# Concepts, Introduction to the Windows Forms HelpProvider Component

QUESTION NO: 23

You use Visual Studio .NET to create a Windows-based application. The application captures screen shots of a small portion of the visible screen.

You create a form named TestKingCameraForm. You set the TestKingCameraForm.BackColor property to Blue. You create a button on the form to enable users to take a screen shot. Now, you need to create a transparent portion of TestKingCameraForm to frame a small portion of the screen. Your application will capture an image of the screen inside the transparent area. The resulting appearance of TestKIngCameraForm is shown in the exhibit:

% WindowsApplicationl -

File Edit View Project Guild Debug Icoli Window Help u y jt m m

Debug validating

[gj :ins-help:/VMS.VSCC7MS.M£DNVS/vbcon/ - | li ^ ^

► H G Ui

+ is xi 5

Hex

1 bread

*

Stack Fi

Iniroductior! to t...nivi<le; Component

Fomnl.vb [Design] Fornnl.v!:-

■.i4 Visual Banc and Visual C# Concepts Introduction to the Windows Forms

■.i4 Visual Banc and Visual C# Concepts Introduction to the Windows Forms

SScreenShols

"The Windows Forms HelpProvider component an .htm file) with your Windows application.

• Provide context-sensitive Help fcr control

• Provide context-sensitive Help on a partic

Adding a HelpProvider component to your 11 component, This enables you to pro'ide help I the HelpNarr:espace pro petty ..-You specify the for the specified control.-You provide the key

Optionally, tc associate a specific Help string method is displayed in a pop-up window whei

If HelpNamespace has not been set, you nr | Help based on HeJpNamespace will take pr

When it is added to a form, the HelpProvidt See Also

Designing a Help System | Creating Heip

Windows Forms.

dialog box or specific controls on a dialog bo main page of a Table of Contents, the Index lows Form allows the other controls on the for the controls on your Windows Form- You can .e of Help provided by calling SetHeloNavigatcj I or topic for Help by calling the SetHelpKeywl another control, use the Setl-ielpString rnethi le user presses the F1 key while the control ha jse SetHelpString to provide the Help text. Jence.

a .chm file, search fun expose the i ate a Help i providing Tethod.

j have set t

Send feedback to Microsoft gi 2001 Microsoft Corporation, At! rights reserved,

You add a Panel control to TestKingCameraForm and name it transparentPanel. You must ensure that any underlying applications will be visible within the panel.

Which two actions should you take? (Each correct answer presents part of the solution. Choose two.)

A. Set transparentPanel.BackColor to Red.

B. Set transparentPanel.BackColor to Blue.

C. Set transparentPanel.BackgroundImage to None.

D. Set transparentPanel.Visible to False.

E. Set CameraForm.Opacity to 0%.

F. Set CameraForm.TransparencyKey to Red.

G. Set CameraForm.TransparencyKey to Blue.

Answer: A, F Explanation:

A: We set the Background color of the Panel to Red.

F: We then the transparency color of the Form to Red as well.

This will make only the Panel transparent, since the background color of the form is Blue.

QUESTION NO: 24

You develop an inventory management application called TestKingManagement that will call a Microsoft SQL Server stored procedure named sp_GetDailyTestKingSales. The stored procedure will run a query that returns your daily sales total as an output parameter. This total will be displayed to users in a message box.

Your application uses a SqlCommand object to run sp_GetDailyTestKingSales. You write the following code to call sp_GetDailyTestKingSales:

Dim cnn As SqlConnection = New SqlConnection(myConnString) Dim cmd As SqlCommand = New _

SqlCommand("sp_GetInventoryLevel", cnn) cmd.CommandType = CommandType.StoredProcedure

Dim parm As SqlParameter = cmd.Parameters.Add( _

"@ItemTotal", SqlDbType.Int) parm.Direction =ParameterDirection.Output cnn.Open()

cmd.ExecuteNonQuery()

Now you must write additional code to access the output parameter. Which code segment should you use?

cmd.Parameters("@Output").Value.ToString())

cmd.Parameters("@Output").ToString())

cmd.Parameters("@ItemTotal").Value.ToString())

cmd.Parameters("@ItemTotal").ToString())

Answer: C

Explanation: The @ItemTotal parameter is declared as an output parameter with SQL Server data type INT. We use the Value property of the SQLParameter class to retrieve the value of this parameter. We must also convert the INT value to a string value with the ToString method. We then supply this string to the MessageBox.Show method.

0 0

Post a comment