|
Related Questions |
View Answer |
|
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 XYZ will occur during the execution of PatTrac. You want PatTrac to log on to the XYZ 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.
|
View Answer
|
|
You develop a Windows-based application by using Visual Studio .NET. You use XYZ’s intranet to deploy the application to client computers. You use the security configuration of the .NET Framework to configure security for you application at the enterprise policy level.. Virus attacks cause the IT manager at XYZ to tighten security at the machine level. Users report that they can no longer execute your application. How should you correct this problem? A. Include the LevelFinal attribute in the intranet code group policy at the enterprise level by using the Permission View tool (Permview.exe). B. Include the Exclusive attribute in the intranet code group policy at the enterprise level by using the Permission View tool (Permview.exe). C. Include the LevelFinal attribute in the intranet code group policy at the enterprise level by using the Code Access Security Policy tool (Caspol.exe). D. Include the Exclusive attributes in the intranet code group policy at the enterprise level by using the Code Access Security Policy tool (Caspol.exe).
|
View Answer
|
|
You development team used Visual Studio .NET to create an accounting application, which contains a class named XYZAccounts. This class instantiates several classes from a COM component that was created by using Visual Basic 6.0. Each COM component class includes a custom method named ShutDownObject that must be called before terminating references to the class. Software testers report that the COM component appears to remain in memory after the application terminates. You must ensure that the ShutDownObject method of each COM component class is called before XYZAccounts is terminated. What should you do? A. Add code to the Terminate event of XYZAccounts to call the ShutDownObject method of each COM component class. B. Find each location in your code where a reference to XYZAccounts is set to null or goes out of scope. Add code after each instance to manually invoke the Visual Studio .NET garbage collector. C. Add a destructor to XYZAccounts. Add code to the destructor to call the ShutDownObject method of each COM component class. D. Add the procedure private void Finally() to XYZAccounts. Add code to the procedure to call the ShutDownObject method of each COM component class.
|
View Answer
|
|
You company XYZ assigns you to modify a Visual Studio .NET application that was created by a former colleague. However, when you try to build the application, you discover several syntax errors. You need to correct the syntax errors and compile a debug version of the code so the application can be tested. Before compiling, you want to locate each syntax error as quickly as possible. What should you do? Select each error listed in the Task List window. A. Open the Application event log from the Visual Studio .NET Server Explorer window. Select each error listed. B. Run the application in Debug mode. Each time an error is encountered, correct it and continue debugging the application. C. Select Build Solution from the Build menu. When the build fails, correct each error listed in the Output window. D. Select Build Comment Web Pages from the Tools menu. Select each function listed in the report that is generated.
|
View Answer
|
|
You work as a software developer at Comapany.net You use Visual Studio .NET to create an application that tracks support incidents for your technical support department at Comapany.net. You implement the Trace class to write information about run-time errors in a local log file. You also implement a TraceSwitch object named ComapanySwitch, which can turn Trace logging on and off as needed. To maximize application performance, you ensure that ComapanySwitch is disabled by default. You set your Configuration Manager to Release. You compile the application and deploy it to a shared folder on your company intranet. Fifty users access the application from a shortcut on their desktops. One user receives error messages while running the application. You device to enable verbose trace logging within the application for that user. You must ensure that you do not affect application performance for the other users. Which action or actions should you take? (Choose all that apply) A. Set your Configuration Manager to Debug. Compile your application and deploy it locally on the user’s computer. Create a new shortcut on the user’s desktop to access the local copy of the application. B. Copy the deployed version of the application from the shared folder. Deploy it locally on the user’s computer. Create a new desktop shortcut on the user’s desktop to access the local copy of the application. C. ComapanySwitch with a value of 4. D. Edit the .config file for the application on the shared folder to enable ComapanySwitch with a value of 4. E. Start the application with the /d:TRACE=TRUE command line option. F. Start the application with the /TRACE ComapanySwitch 4 command line option.
|
View Answer
|
|
You use Visual Studio .NET to create a Windows-based application. The application includes a form named XYZProcedures (EXP). EXP allows users to enter very lengthy text into a database. When users click the Print button located on EXP, this text must be printed by the default printer. You implement the printing functionality by using the native .NET System Class Libraries with all default settings. Users report that only the first page of the text is being printed. How should you correct this problem? A. In the BeginPrint event, set the HasMorePages property of the PrintEventArgs object to True. B. In the EndPrint event, set the HasMorePages property of the PrintEventArgs object to True. C. In the PrintPage event, set the HasMorePages property of the PrintPageEventArgs object to True. D. In the QueryPageSettings event, set the HasMorePages property of the QueryPageSettingEventArgs object to True.
|
View Answer
|
|
Your XYZ project team uses Visual Studio .NET to create an accounting application. Each team member uses the Write method of both the Debug class and the Trace class to record information about application execution in the Windows 2000 event log.. You are performing integration testing for the application. You need to ensure that only one entry is added to the event log each time a call is made to the Write method of either the Debug class or the Trace class. What are two possible code segments for you to use? (Each correct answer presents a complete solution. Choose two) A. EventLogTraceListener myTraceListener = new EventLogTraceListener(“myEventLogSource”); B. EventLogTraceListener myDebugListener = new EventLogTraceListener(“myEventLogSource”); Debug.Listeners.Add(myDebugListener); C. EventLogTraceListener myTraceListener = new EventLogTraceListener(“myEventLogSource”); Debug.Listeners.Add(myTraceListener); Trace.Listeners.Add(myTraceListener); D. EventLogTraceListener myDebugListener = new EventLogTraceListener(“myEventLogSource”); EventLogTraceListener myTraceListener = new EventLogTraceListener(“myEventLogSource”); Debug.Listeners.Add(myDebugListener); Trace.Listeners.Add(myTraceListener);
|
View Answer
|
|
You develop a Visual Studio .NET application that contains a function named XYZUpdate. For debugging purposes, you need to add an entry to a log file whenever XYZUpdate is executed. The log file is named DebugLog.txt. For maximum readability, you must ensure that each entry in DebugLog.txt appears on a separate line. Which code segment should you use? A. StreamWriter oWriter =. new StreamWriter(File.Open( @”C:DebugLog.txt”, FileMode.Append)); TextWriterTraceListener oListener = new TextWriterTraceListener(oWriter); Debug.Listeners.Add(oListener); Debug.WriteLine(“XYZUpdate “ + DateTime.Now.ToString); B. StreamWriter oWriter = new StreamWriter(File.Open( “C:\DebugLog.txt”, FileMode.Append)); TextWriterTraceListener oListener = new TextWriterTraceListener(oWriter); Debug.Listeners.Add(oListener); Debug.Write(“XYZUpdate “ + DateTime.Now.ToString); C. TextWriterTraceListener oListener = new TextWriterTraceListener(); oListener.Name = “C:\DebugLog.txt”; Debug.Listeners.Add(oListener); Debug.WriteLine(“XYZUpdate “ + DateTime.Now.ToString); D. TextWriterTraceListener oListener = new TextWriterTraceListener(); oListener.Name = “C:\DebugLog.txt”; Debug.Listeners.Add(oListener); Debug.Write(“XYZ“ + DateTime.Now.ToString);
|
View Answer
|
|
You develop an application that invokes a procedure named ProcessRecords. You implement the Trace class to log any errors thrown by ProcessRecords. You direct the Trace output to a local log file named ErrorLog.txt by using the following code segment: StreamWriter oWriter = new StreamWriter( File.Open(logfilePath, FileMode.Append)); TextWriterTraceListener oListener = new TextWriterTraceListener(oWriter); Trace.Listeners.Add(oListener); try { ProcessRecords(); }. catch (Exception oEx) { Trace.WriteLine(“Error: “ + oEx.Message; } finally { } Now you need to add code to your finally construct to write all output in the ErrorLog.txt file and then close the file. You want to write the minimum amount of code to achieve this goal. Which code segment should you use? A. oWriter.Close(); B. Trace.Flush(); oWriter.Close(); C. Trace.AutoFlush = true; oWriter.Close(); D. oWriter.AutoFlush = true; oWriter.Close();
|
View Answer
|
|
You use Visual Studio .NET to create an accounting application. Within this application, you are debugging a function named XYZValidate. This function contains several dozen variables and objects. One of the variables is named bValidationStatus. You create a breakpoint at the top of XYZValidate and run the application within the Visual Studio .NET IDE. As you steep through the code in XYZValidate, you need to view the contents of the bValidationStatus variable. However, you want to avoid seeing the contents of the other variables and objects in the function. You also need to complete the debugging process as quickly as possible. What should you do? A. Open the Locals window. B. From the Command window, print the contents of bValidationStatus by using ? bValidationStatus . C. Open the QuickWatch dialog box for bValidationStatus. D. Add a watch expression for bValidationStatus.
|
View Answer
|
|
You develop a Windows-based application by using Visual Studio .NET. The application includes numerous method calls at startup. After optimizing your application code, you test the application on a variety of client computers. However, the startup time is too slow. You must ensure that your application starts as quickly as possible the first time it runs. What should you do? A. Precompile your application by using the Native Image Generator (Ngen.exe): Install the precompiled application on the client computers. B. Install your application on the client computers. Precompile your application by using the Native Image Generator (Ngen.exe). C. Precompile your application by using the JIT compiler. Install the precompiled application on the client computers. D. Install your application on the client computers. Precompile your application by using the JIT compiler.
|
View Answer
|
|
As a developer at XYZ inc. you develop a Windows-based application by using Visual Studio .NET. The application tracks information about customers, orders, and shipping. Ten users will use this application on the client computers running Windows 2000 Professional. You deploy the application by copying the contents of the project’s in folder to the client computers. Nine users report that the application runs as expected. One user receives the following error message when the application is first executed: “The dynamic link library mscoree.dll could not be found in the specified path CProgram FilesOrders App;.;C:WINNTSystem32;C:WINNTSystem;C:WINNTSystem32;C:WINNT;C:WINNTSystem 32Wbem.” You need to correct this problem on the client computer. What should you do? A. Install MDAC 2.7. B. Install Internet Explorer 6. C. Install the redistribute package for the .NET Framework. D. Recopy the contents of the in folder.
|
View Answer
|
|
You develop a Windows-based application by using Visual Studio .NET. The application includes a form named XYZForm and a class named Contact. XYZForm includes a button named cmdCreateContact. You must ensure that your application creates an instance of Contact when a user clicks this button. You want to write the most efficient code possible. Which code segment should you use? A. Contact contact = new Object(); B. Contact contact = new Contact; C. Object contact = new Contact; D. Contact contact = new Object;
|
View Answer
|
|
You use Visual Studio .NET to create a Windows-based application that will track camera sales. The application's main object is named Camera. The Camera class is created by the following definition: public class Camera { } You write code that sets properties for the Camera class. This code must be executed as soon as an instance of the Camera class is created. Now you need to create a procedure in which you can place your code. Which code segment should you use? A. public Camera() B. public void Camera() C. public bool Camera() D. public New() E. public Camera New() F. public Camera Camera()
|
View Answer
|
|
You use Visual Studio .NET to develop an application that contains 50 forms. You create a procedure named PerformCalculations, which writes the results of several internal calculations to the Debug window. These calculations take more than one minute to execute. You want to be able to compile two versions of the application, one for debugging and the other for release. The debugging version should execute the calculations. The release version should not include or compile the calculations. You want to accomplish this goal by using the minimum amount of code. Which two actions should you take? (Each correct answer presents part of the solution. Choose two) A. Use the following code segment: #if DEBUG // Insert code to perform calculations. #endif B. Use the following code segment: if (DEBUG) { // Insert code to perform calculations. } C. Use the following code segment at the top of the module: #define DEBUG D. Add DEBUG = true to the Command Line Arguments box on the Debugging pane of the Project Properties dialog box. E. Ensure that the Conditional Compilation Constants option in the Build pane of the Project Properties dialog box contains the value DEBUG. F. Ensure that the Conditional Compilation Constants options in the Build pane of the Project Properties dialog box includes the value TRACE.
|
View Answer
|
|
You are a developer for a XYZ Inc that provides free software over the Internet. You are developing en e-mail application that users all over the world can download. The application displays text strings in the user interface. At run time, these text strings must appear in the language that is appropriate to the locale setting of the computer running the application. You have resources to develop versions of the application for only four different cultures. You must ensure that your application will also be usable by people of other cultures. How should you prepare the application for deployment? A. Package a different assembly for each culture. B. Package a different executable file for each culture. C. Package a main assembly for source code and the default culture. Package satellite assemblies for the other cultures. D. Package a main assembly for source code. Package satellite assemblies for each culture.
|
View Answer
|
|
You create a Windows Form named XYZForm. The form enables users to maintain database records in a table named XYZ. You need to add several pairs of controls to XYZForm. You must fulfill the following requirements:. • Each pair of controls must represent one column in the XYZ table. • Each pair must consist of a TextBox control and a Label control. • The LostFocus event of each TextBox control must call a procedure named UpdateDatabase. • Additional forms similar to XYZForm must be created for other tables in the database. • Application performance must be optimized. • The amount of necessary code must be minimized. What should you do? A. Create and select a TextBox control and a Label control. Write the appropriate code in the LostFocus event of the TextBox control. Repeatedly copy and paste the controls into XYZForm until every column in the XYZ table has a pair of controls. Repeat this process for the other forms. B. Add a TextBox control and a Label controls to XYZForm. Write the appropriate code in the LostFocus event of the TextBox control. Create a control array form the TextBox control and the Label control. At run time, add additional pairs of controls to the control array until every column in the XYZ table has a pair of controls. Repeat this process for the other forms. C. Create a new user control that includes a TextBox control and a Label control. Write the appropriate code in the LostFocus event of the TextBox control. For each column in the XYZ table, add one instance of the user control to the XYZForm. Repeat this process for the other forms. D. Create a new ActiveX control that includes a TextBox control and a Label control. For each column in the XYZ table, add one instance of the ActiveX control to XYZForm. Repeat this process for the other forms.
|
View Answer
|
|
You use Visual Studio .NET to create a control that will be used on several forms in your application. It is a custom label control that retrieves and displays your company’s current stock price. The control will be displayed on many forms that have different backgrounds. You want the control to show as much of the underlying form as possible. You want to ensure that only the stock price is visible. The rectangular control itself should not be visible. You need to add code to the Load event of the control to fulfill these requirements. Which two code segments should you use? (Each correct answer presents part of the solution. Choose two) A. this.BackColor = Color.Transparent; B. this.ForeColor = Color.Transparent; C. this.BackImage = null; D. this.SetStyle(ControlStyles.UserPaint, false); E. this.SetStyle(ControlStyles.SupportsTransparentBackColor, true);
|
View Answer
|
|
You use Visual Studio .NET to create a Windows-based application for online gaming. Each user will run the client version of the application on his or her local computer. In the game, each user controls two groups of soldiers, Group1 and Group2. You create a top-level menu item whose caption is Groups. Under this menu, you create two submenus. One is named group1Submenu, and its caption is Group 1. The other is named group2Submenu, and its caption is Group 2. When the user select the Groups menu, the two submenus will be displayed. The user can select only one group of soldiers at a time. You must ensure that a group can be selected either by clicSheets the appropriate submenu item or by holding down the ALT key and pressing 1 or 2. You must also ensure that the group currently select will be indicated by a dot next to the corresponding submenu item. You do not want to change the caption text of any of your menu items. Which four actions should you take? (Each correct answer presents part of the solution. Choose four) A. Set group1Submenu.Text to “Group &1”. Set group2Submenu.Text to “Group &2”. B. Set Group1.ShortCut to “ALT1”. Set Group2.ShortCut to “ALT2”. C. In the group1Submenu.Click event, place the following code segment: group1Submenu.DefaultItem = true; In the group2Submenu.Click event, place the following code segment: group2Submenu.DefaultItem = true; D. In the group1Submenu.Click event, place the following code segment: group2Submenu.DefaultItem = false; In the group2Submenu.Click event, place the following code segment: group1Submenu.DefaultItem = false; E. In the group1Submenu.Click event, place the following code segment: group1Submenu.Checked = true; In the group2Submenu.Click event, place the following code segment: group2Submenu.Checked = true; F. In the group1Submenu.Click event, place the following code segment: group2Submenu.Checked = false; In the group2Submenu.Click event, place the following code segment: group1Submenu.Checked = false; G. Set group1Submenu.RadioCheck to True. Set group2Submenu.RadioCheck to True. H. Set group1Submenu.RadioCheck to False. Set group2Submenu.RadioCheck to False.
|
View Answer
|
|
You responsible for maintaining an application that was written by a former colleague at XYZ. The application reads from and writes to log files located on the local network. The original author included the following debugging code to facilitate maintenance: try { Debug.WriteLine(“Inside Try”); throw(new IOException());} catch (IOException e) { Debug.WriteLine (“IOException Caught”);} catch (Exception e) { Debug.WriteLine(“Exception Caught”);}. finally { Debug.WriteLine (“Inside Finally”);} Debug.WriteLine (“After End Try”); Which output is produced by thus code? A. Inside Try Exception Caught IOException Caught Inside Finally After End Try B. Inside Try Exception Caught Inside Finally After End Try C. Inside Try IOException Caught Inside Finally After End Try D. Inside Try IOException Caught Inside Finally
|
View Answer
|