Exam4Training

GIAC GSSP-.NET GIAC Secure Software Programmer – C#.NET Online Training

Question #1

You work as a Software Developer for ABC Inc. The company uses Visual Studio .NET 2008 as its application development platform. You create an ASP.NET Web application using .NET Framework 3.5. You create a Web form in the application that permits users to provide personal information. You add a DropDownList control to the Web form to retrieve the residential status of users. The default item that the DropDownList control displays is the "Select Country" option. You have to ensure that users select a country other than the default option.

Which of the following validation controls should you use to accomplish this task?

  • A . RangeValidator
  • B . RequiredFieldValidator
  • C . CustomValidator
  • D . RegularExpressionValidator

Reveal Solution Hide Solution

Correct Answer: B
Question #2

Sam works as a Software Developer for GenTech Inc. He develops an application named App1 using Visual Basic .NET. App1 uses a non-COM DLL named Value1.dll, which contains unmanaged code. Sam writes a method named Method1 in Value1.dll as follows:

Method1 Lib "Value1.dll"(ByVal InputVar As String, ByRef WordsVar As String, ByRef

NumbersVar As Integer) As Integer

Sam wants to use Method1 for parsing a string into an array of string values and an array of integers. Sam wants to enable App1 to call this function.

Which of the following statements about the method are true? Each correct answer represents a complete solution. Choose all that apply.

  • A . The value of the first parameter cannot be changed by a procedure or a function.
  • B . The second parameter will contain all string values found in the first parameter.
  • C . The third parameter will contain all integer values found in the second parameter.
  • D . The third parameter will contain all string values found in the second parameter.

Reveal Solution Hide Solution

Correct Answer: A,B,C
Question #3

You work as a Software Developer for ManSoft Inc. The company has several branches worldwide. The company uses Visual Studio.NET 2005 as its application development platform. You create an application that will be used by all the branches of the company. You use the Regex class in the application to validate some strings. You want to search an input string for an occurrence of a regular expression.

Which of the following methods of the Regex class will you use to accomplish the task?

  • A . Match
  • B . Matches
  • C . Equals
  • D . IsMatch

Reveal Solution Hide Solution

Correct Answer: A
Question #4

You work as a Web Application Developer for SunInfo Inc. The company uses Visual Studio 2008 as its application development platform. You create a Web application using .NET Framework 3.5. You want to attach the Visual Studio Debugger to Internet Explorer when the application is running.

Which of the following steps will you take to accomplish the task? Each correct answer represents a part of the solution. Choose all that apply.

  • A . In the Attach to Process dialog box, select the instance of Internet Explorer (iexplorer.exe) to be attached to the debugger.
  • B . In Visual Studio, go to the Debug menu and select Start Debugging.
  • C . In Visual Studio, go to the Debug menu, click Windows, and then click Script Explorer.
  • D . In Visual Studio, go to the Debug menu and click Attach to Process.

Reveal Solution Hide Solution

Correct Answer: A,D
Question #5

You work as a Software Developer for ABC Inc. The company uses Visual Studio .NET 2005 as its application development platform. You have recently finished development of a Windows application using .NET Framework. Users report that the application is not running properly.

When the users try to complete a particular action, the following error message comes out:

Unable to find assembly ‘myservices, Version=1.0.0.0, Culture=neutral,

PublicKeyToken=29b5ad26c9de9b95′.

You notice that the error occurs as soon as the application tries to call functionality in a serviced component that was registered by using the following command:

regsvcs.exe myservices.dll

You must make sure that the application can call the functionality in the serviced component with no exceptions being thrown.

What will you do to accomplish this task?

  • A . Run the command line tool: regasm.exe myservices.dll.
  • B . Copy the serviced component assembly into the C:Program FilesComPlus Applications fold er.
  • C . Run the command line tool: gacutil.exe /i myservices.dll.
  • D . Copy the serviced component assembly into the C:WINDOWSsystem32Com folder.

Reveal Solution Hide Solution

Correct Answer: C
Question #6

Patrick works as a Software Developer for GenTech Inc. He develops an application, named App1, using Visual C# .NET. He implements security using the security classes of the .NET Framework. He defines the following statements in the application:

PrincipalPermission Principal_Perm1 = new PrincipalPermission("Nick", "General

Manager");

PrincipalPermission Principal_Perm2 = new PrincipalPermission("Jack", "Accountant");

Patrick wants to check whether all demands that succeed for Principal_Perm1 also succeed for Principal_Perm2.

Which of the following methods of the PrincipalPermission class will he use to accomplish this?

  • A . Intersect
  • B . IsSubSetOf
  • C . IsUnrestricted
  • D . Union

Reveal Solution Hide Solution

Correct Answer: B
Question #7

ASP.NET version 2.0 health monitoring supports an __________.

  • A . Event driven model
  • B . Event provider model
  • C . Event log model
  • D . Event API model

Reveal Solution Hide Solution

Correct Answer: B
Question #8

You work as a Windows Application Developer for ABC Inc. The company uses Visual Studio .NET 2008 as its application development platform. You create a Windows Forms application using .NET Framework 3.5. The application contains a data-bound control. You use the LinqDataSource control to use LINQ in the ASP.NET application by setting properties in markup text. The LinqDataSource control uses LINQ to SQL to automatically generate the data commands. You are required to perform data operations by using the LinqDataSource control.

What is the correct order in which data operations are applied?

  • A .

Reveal Solution Hide Solution

Correct Answer: A
Question #9

You work as a Windows Application Developer for ABC Inc. The company uses Visual Studio .NET 2008 as its application development platform. You are creating a Windows Forms application using .NET Framework 3.5. You need to develop a new control for the application. You must ensure that the control inherits the TreeView control by adding a custom node tag and a highlight color.

What will you do?

  • A . Set the control’s DrawMode property to OwnerDrawText, and then implement a custom DrawNode event handler.
  • B . Set the control’s DrawMode property to OwnerDrawAll, and then implement a custom DrawNode event handler.
  • C . Write a code segment in the DrawNode event handler to give the highlight color.
  • D . Override the OnPaint method.

Reveal Solution Hide Solution

Correct Answer: A
Question #10

You work as a Software Developer for ABC Inc. The company has several branches Worldwide. The company uses Visual Studio.NET 2005 as its application development platform. You are creating an applications using .NET Framework 2.0. You want to allow users to view various details of a given unmanaged code.

What will you do to accomplish the task?

  • A . Use a COM/DCOM server.
  • B . Use the Dispinterface.
  • C . Use the Makecert.exe.
  • D . Use the dumpbin.exe.

Reveal Solution Hide Solution

Correct Answer: D

Question #11

Mark works as a Software Developer for Mansoft Inc. He develops an application using Visual

Studio .NET 2005.

He writes the following code snippet in the application:

public class MyClass

{

public static void Main(String[] args)

{

try

{

return;

}

finally

{

Console.WriteLine("Finally");

}

}

}

What will happen when Mark attempts to compile and execute the code snippet?

  • A . The code snippet will compile successfully and the output will be displayed as "Finally".
  • B . The code snippet will compile successfully, but an exception message will be displayed at ru ntime.
  • C . A compile-time error will occur because the catch block is not defined.
  • D . The code snippet will compile successfully, but nothing will be displayed as output on execu tion.

Reveal Solution Hide Solution

Correct Answer: A
Question #12

Which of the following modifiers in C# will you use if you do NOT want a custom-build component to be a base class?

  • A . sealed
  • B . virtual
  • C . override
  • D . static

Reveal Solution Hide Solution

Correct Answer: A
Question #13

You work as a Software Developer for ABC Inc. The company uses Visual Studio .NET 2005 as its application development platform. You have recently finished development of a Windows application using .NET Framework. Users report that the application is not running properly. When the users try to complete a particular action, the following error message comes out:

Unable to find assembly ‘myservices, Version=1.0.0.0, Culture=neutral, PublicKeyToken=29b5ad26c9de9b95’.

You notice that the error occurs as soon as the application tries to call functionality in a serviced component that was registered by using the following command:

regsvcs.exe myservices.dll

You must make sure that the application can call the functionality in the serviced component with no exceptions being thrown.

What will you do to accomplish this task?

  • A . Run the command line tool: regasm.exe myservices.dll.
  • B . Copy the serviced component assembly into the C:Program FilesComPlus Applications fold er.
  • C . Run the command line tool: gacutil.exe /i myservices.dll.
  • D . Copy the serviced component assembly into the C:WINDOWSsystem32Com folder.

Reveal Solution Hide Solution

Correct Answer: C
Question #14

Smith works as a Software Developer for BlueWell Inc. He develops a Web application named WebApp by using Visual Studio .NET. He wants to deploy WebApp on a target computer. He wants to take precautionary measures in the application so that no issues may arise while deploying it.

Which of the following measures will Smith take to accomplish the task? Each correct answer represents a complete solution. Choose all that apply.

  • A . Organize data in the application configuration files.
  • B . Use a tracing feature to trace and gather information about each step in the program execu tion.
  • C . Use a technique to avoid errors and to store error-related information.
  • D . Use a debugger to step through the application code while it is running.
  • E . Respond to health monitoring events in order to log performance and error-related conditio ns.

Reveal Solution Hide Solution

Correct Answer: B,C,D,E
Question #15

Allen works as a Software Developer for ABC Inc. The company uses Visual Studio.NET as its application development platform. He creates an application using .NET Framework. He wants to encrypt all his e-mails that he sends to anyone.

Which of the following will he use to accomplish the task?

  • A . PPP
  • B . FTP
  • C . PGP
  • D . PPTP

Reveal Solution Hide Solution

Correct Answer: C
Question #16

You work as a software developer for ManSoft Inc. The company uses Visual Studio .NET 2005 as its application development platform. You use C#. NET to create an assembly that will be consumed by other Visual Studio .NET applications. No Permissions should be granted to this assembly unless the assembly makes a minimum permission request. You need to write a code for the assembly that makes a minimum permission request.

Which of the following code segments will you use to accomplish this task?

  • A . [Assembly: PermissionSet(SecurityAction.PermitOnly, Unrestricted = true)]
  • B . [Assembly: PermissionSet(SecurityAction.RequestOptional, Unrestricted = true)]
  • C . [Assembly: PermissionSet(SecurityAction.PermitOnly, Unrestricted = false)]
  • D . [Assembly: PermissionSet(SecurityAction.RequestOptional, Unrestricted = false)]

Reveal Solution Hide Solution

Correct Answer: D
Question #17

You work as a Web Application Developer for SunInfo Inc. The company uses Visual Studio 2008 as its application development platform. You create a Web application using .NET Framework 3.5. You want to redirect users to a default error page if an unhandled error occurs within your site.

Which of the following actions will you perform to accomplish the task?

  • A . Set the mode attribute of the customErrors element to Off and the defaultRedirect attribute to an error page within your site.
  • B . Set the statusCode attribute of the error element to 404 and the redirect attribute to a custom error page.
  • C . Set the redirect attribute of the error element to an error page within your site.
  • D . Set the mode attribute of the customErrors element to On and the defaultRedirect attribute to an error page within your site.

Reveal Solution Hide Solution

Correct Answer: D
Question #18

You work as a Software Developer for ABC Inc. The company uses Visual Studio.NET 2005 as its application development platform. You have recently finished development of an application using .NET Framework 2.0. The application has multiple threads that execute one after another. You want to modify the application and schedule the threads for execution based on their assigned priority.

What will you do to accomplish the task? Each correct answer represents a complete solution. Choose all that apply.

  • A . Use the Highest priority.
  • B . Use the BelowNormal priority.
  • C . Use the Normal priority.
  • D . Use the Middle priority.
  • E . Use the Lowest priority.

Reveal Solution Hide Solution

Correct Answer: A,B,C,E
Question #19

David works as a Software Developer for McRobert Inc. He develops a Web application named App1 using Visual Studio .NET. App1 contains several Web forms that display information about an online shopping process. David wants to provide a Web-based shopping catalog to users. However, he wants to ensure that the information about the shopping catalog is secure and requires no server resources.

What will David do to accomplish the task?

  • A . Use a query string as a user preference.
  • B . Use a session state variable as a user preference.
  • C . Use an application state variable as a user preference.
  • D . Use a session cookie as a user preference.

Reveal Solution Hide Solution

Correct Answer: D
Question #20

You work as a Software Developer for ABC Inc. You create a Console application to create multiple satellite assemblies.

Which of the following statements about satellite assemblies are true? Each correct answer represents a complete solution. Choose all that apply.

  • A . They do not contain any executable code.
  • B . An application can have only one satellite assembly.
  • C . The Assembly Linker tool is used to compile .resources files into satellite assemblies.
  • D . They are used to deploy language-specific resources for an application.

Reveal Solution Hide Solution

Correct Answer: A,C,D

Question #21

You work as a Software Developer for ABC Inc. The company has several branches worldwide. The company uses Visual Studio .NET 2005 as its application development platform. You are creating an application using .NET Framework 2.0. The application will be used by all the branches of the company. You are using the CompareInfo class for culture-sensitive string comparisons.

You write the following code in the application:

String s1 = "C rtify";

String s2 = "c rtify";

String s3 = "c rtify";

You need to compare the s1 string with the s2 string and ensure that the string comparison must ignore case.

Which of the following code segments will you use to accomplish the task?

  • A . CompareInfo cmp = CultureInfo.InvariantCulture.CompareInfo;
    Console.WriteLine(cmp.Compare(s1, s2, CompareOptions.IgnoreCase));
  • B . CompareInfo cmp = CultureInfo.InvariantCulture.CompareInfo;
    Console.WriteLine(cmp.Compare(s1, s2, CompareOptions.None));
  • C . CompareInfo cmp = CultureInfo.InvariantCulture.CompareInfo;
    Console.WriteLine(cmp.Compare(s1, s2, CompareOptions.Ordinal));
  • D . CompareInfo cmp = CultureInfo.InvariantCulture.CompareInfo;
    Console.WriteLine(cmp.Compare(s1, s2, CompareOptions.OrdinalIgnoreCase));

Reveal Solution Hide Solution

Correct Answer: A
Question #22

You work as a Software Developer for ABC Inc. The company uses Visual Studio .NET 2005 as its application development platform. You have recently finished development of a Windows application using .NET Framework. Users report that the application is not running properly. When the users try to complete a particular action, the following error message comes out:

Unable to find assembly ‘myservices, Version=1.0.0.0, Culture=neutral,

PublicKeyToken=29b5ad26c9de9b95′.

You notice that the error occurs as soon as the application tries to call functionality in a serviced component that was registered by using the following command:

regsvcs.exe myservices.dll

You must make sure that the application can call the functionality in the serviced component with no exceptions being thrown.

What will you do to accomplish this task?

  • A . Run the command line tool: regasm.exe myservices.dll.
  • B . Copy the serviced component assembly into the C:Program FilesComPlus Applications fold er.
  • C . Run the command line tool: gacutil.exe /i myservices.dll.
  • D . Copy the serviced component assembly into the C:WINDOWSsystem32Com folder.

Reveal Solution Hide Solution

Correct Answer: C
Question #23

Allen works as a Software Developer for ABC Inc. The company uses Visual Studio.NET as its application development platform. He creates an application using .NET Framework. He wants to encrypt all his e-mails that he sends to anyone.

Which of the following will he use to accomplish the task?

  • A . PPP
  • B . FTP
  • C . PPTP
  • D . PGP

Reveal Solution Hide Solution

Correct Answer: D
Question #24

John works as a Software Developer for DawnStar Inc. He creates a class, named MyClass1. He wants to generate a key pair that he will use to give the compiled assembly a strong name.

Which of the following tools will he use to accomplish the task?

  • A . Installutil.exe
  • B . Gacutil.exe
  • C . Sn.exe
  • D . Al.exe

Reveal Solution Hide Solution

Correct Answer: C
Question #25

You work as a Software Developer for HiTech Inc. You develop a Web application named

MyWebApp. The application contains several Web pages that display a registration form for a user. You want to perform user input data validation at the server-side, so that you can disable the client-side data input validation.

Which of the following actions will you take to accomplish the task?

  • A . Set the CausesValidation property of a server control to false.
  • B . Set the Enabled property of a validation control to true.
  • C . Set the Enabled property of a validation control to false.
  • D . Set the EnableClientScript property of a validation control to true.
  • E . Set the EnableClientScript property of a validation control to false.

Reveal Solution Hide Solution

Correct Answer: E
Question #26

Which of the following is the best encryption algorithm to encrypt and decrypt messages?

  • A . AES
  • B . TripleDES
  • C . DES
  • D . RSA

Reveal Solution Hide Solution

Correct Answer: D
Question #27

You work as a Windows Application Developer for ABC Inc. The company uses Visual Studio .NET 2008 as its application development platform. You are creating a Windows Forms application using .NET Framework 3.5. You need to develop a new control for the application. You must ensure that the control inherits the TreeView control by adding a custom node tag and a highlight color.

What will you do?

  • A . Write a code segment in the DrawNode event handler to give the highlight color.
  • B . Override the OnPaint method.
  • C . Set the control’s DrawMode property to OwnerDrawText, and then implement a custom DrawNode event handler.
  • D . Set the control’s DrawMode property to OwnerDrawAll, and then implement a custom DrawNode event handler.

Reveal Solution Hide Solution

Correct Answer: C
Question #28

Which of the following is an exception of background threads as compared to foreground threads?

  • A . A background thread does not continue the managed execution environment running.
  • B . A background thread does not affect the outcome of an unhandled exception.
  • C . A background thread belongs to the managed thread pool.
  • D . A background thread changes to a foreground thread at any time.

Reveal Solution Hide Solution

Correct Answer: A
Question #29

You work as an Application Developer for ABC Inc. You are assigned with developing a Web site that will handle information related to monthly sales of the company. You wish to secure the Web site so that only employees of the Accounts department can view the Web pages. You need to create roles for the employees of this department. The user account information will be stored in a SQL Server database named Database. You decide to do all this by using the Web Site Administration Tool.

Which of the following types of security will you use to accomplish the task?

  • A . Forms-based authentication
  • B . Integrated Microsoft Windows authentication
  • C . Basic authentication
  • D . Digest authentication

Reveal Solution Hide Solution

Correct Answer: A
Question #30

Which of the following providers is a block cipher that encrypts and decrypts data in blocks of 8 bytes?

  • A . RNGCryptoServiceProvider
  • B . SHA1CryptoServiceProvider
  • C . RC2CryptoServiceProvider
  • D . RSACryptoServiceProvider

Reveal Solution Hide Solution

Correct Answer: C

Question #31

You work as a Software Developer for ABC Inc. The company uses Visual Studio .NET 2005 as its application development platform. You create a Web service using the .NET Framework 2.0. You call a method in the Web service. The following exception is thrown in the Web service: client.System.Web.Services.Protocols.SoapException: Server was unable to process request. System.NullReferenceException: Object reference not set to an instance of an object. You find out that it is the following line of code that throws the exception: if (Session ["StoredValue"] == null)

You must ensure that the method runs without throwing any exception.

What will you do to accomplish this task?

  • A . Modify the WebMethod attribute in the Web service so that the EnableSession property is set to true.
  • B . Add the following to the System.Web section of the Web.config file:
    <sessionState mode="InProc" />
  • C . Add the following to the System.Web section of the Web.config file:
    <httpModules>
    <add name="Session" type="System.Web.SessionState.SessionStateModule" /> </httpModules>
  • D . In the client code for the Web service’s proxy object, assign a new instance of the System.Net.CookieContainer object to the CookieContainer property.
  • E . In the client code for the Web service’s proxy object, assign a new instance of the System.Net.CookieContainer object to the EnableSession property.

Reveal Solution Hide Solution

Correct Answer: A
Question #32

You work as a Software Developer for ManSoft Inc. You create an assembly. You place the assembly in a specific folder.

Which of the following classes can you use to determine whether the assembly was located in a specific folder? Each correct answer represents a complete solution. Choose two.

  • A . UrlMembershipCondition
  • B . ApplicationDirectoryMembershipCondition
  • C . GacMembershipCondition
  • D . SiteMembershipCondition

Reveal Solution Hide Solution

Correct Answer: A,B
Question #33

You work as a Web Application Developer for SunInfo Inc. The company uses Visual Studio 2008 as its application development platform. You create a Web application using .NET Framework 3.5. You want to ensure that when an unhandled exception occurs on the site, a custom error page errorpage.aspx is displayed. Also, you want to ensure that when the HTTP 500 error occurs, the servererror.aspx page is displayed.

Which of the following settings will you add inside the system.web section of the Web.config file to accomplish the task?

  • A . <compilation debug="true">
    </compilation>
  • B . <customErrors defaultRedirect="errorpage.aspx" mode="on"> <error statusCode="500" redirect="servererror.aspx"/>
  • C . <customErrors defaultRedirect="servererror.aspx" mode="on"> <error statusCode="500" redirect="errorpage.aspx"/>
  • D . <trace enabled="true" localOnly="false" />

Reveal Solution Hide Solution

Correct Answer: B
Question #34

John works as a Software Developer for InfoTech Inc. He develops an application named SerializeObj. He creates a custom class and wants to serialize its object. He also wants the object to be stored into an XML file named File1.xml.

He writes the following code:

public class Employees

{

public string EmpID;

public string EmpName;

public decimal Salary;

}

Which of the following code statements will John add in the application?

  • A . XmlSerializer ObjectSerializer = new XmlSerializer(typeof(Employees), ObjectTypes);
  • B . XmlSerializer ObjectSerializer = new XmlSerializer(typeof(Employees));
  • C . XmlSerializer ObjectSerializer = new XmlSerializer(Employees);
  • D . XmlSerializer ObjectSerializer = new XmlSerializer();

Reveal Solution Hide Solution

Correct Answer: B
Question #35

Which of the following techniques is used to transmit passwords during authentication?

  • A . Asymmetric encryption
  • B . Hashing
  • C . Salted Hash
  • D . Symmetric encryption

Reveal Solution Hide Solution

Correct Answer: C
Question #36

You work as a Software Developer for ABC Inc. The company uses Visual Studio.NET 2005 as its application development platform. You have recently finished development of Web services using the .NET Framework. The access control to Web services is part of your accountability. You are currently revealing an existing class as a XML Web service. You are required to ensure that the XML Web service is exclusively accessible to Web service clients within the ABC Inc. domain. To fulfill this requirement you want to change the access modifiers on methods that must be represented as Web methods.

What will you do to accomplish this task?

  • A . Use the Public access modifier for each Web method.
  • B . Use the Private access modifier for each Web method.
  • C . Use the Internal or Friend access modifier for each Web method.
  • D . Use the Protected access modifier for each Web method.

Reveal Solution Hide Solution

Correct Answer: A
Question #37

Georgina works as a Software Developer for BlueChip Inc. She develops an application named App1 using Visual Studio .NET. The company wants her to deploy App1 to a customer’s laptop. Georgina creates an assembly named Assembly1 to be stored in the Global Assembly Cache so that the Common Language Runtime (CLR) can locate and bind Assembly1.

As the application executes, the CLR locates the path of Assembly1 through the codebase setting. But, it finds no <codebase> element in the app.config file, and fails to bind Assembly1. Now, the CLR tries to locate Assembly1 through probing.

Which of the following will the CLR check to locate Assembly1? Each correct answer represents a part of the solution. Choose all that apply.

  • A . Previously loaded assemblies
  • B . The application base or root directory
  • C . The Gacutil.exe tool in the Global Assembly Cache
  • D . Sub-directories in the application’s root directory
  • E . The culture attribute of the assembly
  • F . The correct version of the assembly
  • G . The assembly’s name

Reveal Solution Hide Solution

Correct Answer: B,D,E,G
Question #38

You work as a Software Developer for ABC Inc. The company uses Visual Studio.NET 2008 as its application development platform. You create an ASP.NET Web application using the .NET Framework 3.5. You want to use a HTTP module called on each and every request made by the application. It is called as part of the ASP.NET request pipeline. It has right to access life-cycle events throughout the request. You also want to ensure that the HTTP module allows a user to inspect incoming and outgoing requests and take appropriate action based on the request.

What will be the correct order to create the HTTP module?

  • A .

Reveal Solution Hide Solution

Correct Answer: A
Question #39

You work as a Web Administrator for BlueWell Inc. The company’s sales employees access the Web server from remote locations via the Internet using Netscape Navigator or Internet Explorer. You want to secure the Web server. To secure the Web server, you want to use cookieless forms authentication.

Which of the following properties will you use to accomplish the task?

  • A . FormsCookiePath
  • B . CookieDomain
  • C . CookieMode
  • D . FormsCookieName

Reveal Solution Hide Solution

Correct Answer: C
Question #40

Which of the following security methods is used when the code requires a specific set of permissions, which are not known until runtime?

  • A . Role-Based Security
  • B . Windows NT Security
  • C . Imperative Security
  • D . Declarative Security

Reveal Solution Hide Solution

Correct Answer: C

Question #41

You work as a Software Developer for ABC Inc. You develop a multi-threaded application named MyMultThreadApp using Visual Studio .NET. The application logs all warning and informational messages in an event log that keeps track of significant events when the application is running. The event log records information that might be useful for troubleshooting or performance analysis.

Which of the following are the considerations that you must keep in mind when logging events with multithreaded components? Each correct answer represents a complete solution. Choose three.

  • A . An exclusive lock should be obtained on the log to avoid race conditions.
  • B . Each shared component should be thread-safe when interacting with an event log.
  • C . The System.Threading namespace should be used to record the identity of each thread for logging messages.
  • D . The Debug and Trace classes should be used to log events.

Reveal Solution Hide Solution

Correct Answer: A,B,C
Question #42

You work as a Software Developer for ABC Inc. The company uses Visual Studio .NET as its application development platform. You are creating an application using the .NET Framework.

You write the following code snippet to call a method from the Win32 API by using PInvoke:

int rst = MessageBox(hWd, Mytext, Mycaption, Mytype);

You are required define a method prototype.

Which of the following code segments will you use to accomplish this task?

  • A . [DllImport("user32")] extern int MessageBoxA(int hWd, String Mytext, String Mycaption, uint Mytype);
  • B . [DllImport("user32")] extern int Win32API_User32_MessageBox(Int hWd, String Mytext, String Mycaption, uint Mytype);
  • C . [DllImport("user32")] extern int MessageBox(int hWd, String Mytext, String Mycaption, uint Mytype);
  • D . [DllImport("C:\WINDOWS\system32\user32.dll")] extern int MessageBox(int hWd, String Mytext, String Mycaption, uint Mytype);

Reveal Solution Hide Solution

Correct Answer: C
Question #43

John works as a Web developer for HiTech Inc. He develops an application named MyApp by using Visual C# .NET. John uses a SQL Server database.

He writes the following code:

OleDbCommand cmd = new OleDbCommand();

cmd.CommandText = "UPDATE Employees SET Rank = ‘Senior’ WHERE Basic > 10000";

cmd.ExecuteNonQuery();

Now he wants to improve the performance of the program code.

Which of the following actions will he perform to accomplish the task? Each correct answer represents a complete solution. Choose all that apply.

  • A . Use database indexing.
  • B . Use an OleDbDataReader object to execute the program code.
  • C . Use a Cache object to execute the program code.
  • D . Use a SqlCommand object instead of an OleDbCommand object.
  • E . Use a stored procedure instead of the CommandText property.
  • F . Use the Prepare method on the OleDbCommand object before executing the program code.

Reveal Solution Hide Solution

Correct Answer: D,E
Question #44

You work as a Software Developer for Webtech Inc. You plan to migrate the existing Active Server Pages (ASP) pages to ASP.NET Web pages in order to implement rich functionalities of a Web browser in your Web pages. Therefore, you want to add controls to Web pages of your existing application named WebApp1.

Which of the following controls will be most suitable to implement?

  • A . HTML server controls
  • B . Web server controls
  • C . Validation controls
  • D . HTML controls

Reveal Solution Hide Solution

Correct Answer: B
Question #45

Which of the following session and instancing modes will you set if you require a sessionfull binding and want to create a new instance object for each client request?

  • A . Set SessionMode to Allowed and IntsanceMode to PerSession.
  • B . Set SessionMode to Required and IntsanceMode to Single.
  • C . Set SessionMode to Required and IntsanceMode to PerCall.
  • D . Set SessionMode to Allowed and IntsanceMode to PerCall.

Reveal Solution Hide Solution

Correct Answer: C
Question #46

You work as a Web Application Developer for ABC Inc. The company uses Visual Studio .NET as its application development platform. You create an ASP.NET Web application using the .NET Framework. The application is installed in a Network Load Balancing cluster. You are evaluating a bug statement. When a failure takes place in the Web application, the client occasionally gets an error page as anticipated. At other times, the client gets an exception stack with the error message, which is not anticipated. You are required to find out the configuration setting that causes the unanticipated error.

Which of the following configuration settings causes the unanticipated error?

  • A . <customErrors mode="Off" />
  • B . <compilation debug="false" />
  • C . <compilation debug="true" />
  • D . <customErrors mode="On" />

Reveal Solution Hide Solution

Correct Answer: A
Question #47

In which of the following objects are session variables stored?

  • A . SessionStateStoreData
  • B . SessionStateModule
  • C . SessionStateItemCollection
  • D . SessionStateStoreProviderBase

Reveal Solution Hide Solution

Correct Answer: C
Question #48

Bill works as a Software Developer for SunInfo Inc. He develops an application named SunApplication using C# .NET. The employees of the company use SunApplication for viewing and editing inventory data. SunApplication receives data from a file named MyFile.xml, which currently does not provide any information. Bill decides to write code to get information from the MyFile.xml file.

Which of the following code segments will he use to resolve the issue? Each correct answer represents a complete solution. Choose all that apply.

  • A . FileInfo FI = new FileInfo(@"c:tempMyFile.xml");
    Console.WriteLine("Filename " + FI.FullName );
    Console.WriteLine(" Created at " + FI.CreationTime );
    Console.WriteLine(" Accessed at " + FI.LastAccessTime );
  • B . FileInfo FI = new FileInfo ("@c:program filestempMyFile.xml");
    Console.WriteLine ("Filename " + FI.FullName );
    Console.WriteLine(" Created at " + FI.CreationTime );
    Console.WriteLine(" Accessed at " + FI.LastAccessTime );
  • C . FileInfo FI = new FileInfo("MyFile.xml");
    Console.WriteLine("Filename " + FI.FullName );
    Console.WriteLine(" Created at " + FI.CreationTime );
    Console.WriteLine(" Accessed at " + FI.LastAccessTime );
  • D . string str=@"c:windowsMyFile.xml";
    FileInfo FI = new FileInfo (str);
    FI.Open (FileMode.Open, FileAccess.Read);
    Console.WriteLine("Filename " + FI.FullName );
    Console.WriteLine(" Created at " + FI.CreationTime );
    Console.WriteLine(" Accessed at " + FI.LastAccessTime );

Reveal Solution Hide Solution

Correct Answer: A,C,D
Question #49

You work as a Software Developer for ABC Inc. The company has several branches worldwide. The company uses Visual Studio.NET 2005 as its application development platform. You have recently finished the development of an application using .NET Framework 2.0. The application can be used only for cryptography. Therefore, you have implemented the application on a computer.

What will you call the computer that implemented cryptography?

  • A . Cryptographic toolkit
  • B . Cryptosystem
  • C . Cryptographer
  • D . Cryptanalyst

Reveal Solution Hide Solution

Correct Answer: B
Question #50

Tony works as a Software Developer for TechNet Inc. He creates a satellite assembly named

SatAssembly1. He wants to install SatAssembly1 in the global assembly cache. Therefore, he compiles the assembly by using the Al.exe tool and signs SatAssembly1.

Which of the following possible tools will Tony use to sign SatAssembly1? Each correct answer represents a complete solution. Choose two.

  • A . Installer tool
  • B . File Signing tool
  • C . .NET Services Installation tool
  • D . Strong Name tool

Reveal Solution Hide Solution

Correct Answer: B,C

Question #51

What is the main purpose of a try-catch block?

  • A . To obtain and use resources that are being caught.
  • B . To signal the occurrence of an exception during the program execution.
  • C . To catch and handle an exception generated by an executable code.
  • D . To ensure that the necessary cleanup of external resources is done immediately.

Reveal Solution Hide Solution

Correct Answer: C
Question #52

You work as a Software Developer for ABC Inc. The company uses Visual Studio.NET 2005 as its application development platform. You create a Web service using .NET Framework 2.0. You want the Web service to utilize a two step process to map XML

generated by Web methods to .NET objects.

What will you do to accomplish the task? Each correct answer represents a part of the solution. Choose two.

  • A . Use deserialization
  • B . Use serialization
  • C . Use Marshal-by-ref objects
  • D . Use Marshal-by-value objects

Reveal Solution Hide Solution

Correct Answer: A,B
Question #53

Which of the following data structures is used for storing reference data types?

  • A . Stack
  • B . Queue
  • C . Hard disk
  • D . Heap

Reveal Solution Hide Solution

Correct Answer: D
Question #54

ECMAScript is supported in many applications and is commonly known as __________.

  • A . VBScript
  • B . AJAX
  • C . JavaScript
  • D . Script

Reveal Solution Hide Solution

Correct Answer: C
Question #55

David works as a Software Developer for GenTech Inc. He creates an XML Web service, named MyWebService, using Visual Studio .NET. MyWebService uses Microsoft Windows authentication. Users of MyWebService are in the GenTech domain.

David wants to configure MyWebService to use the following URL-based authorization rules:

l Anonymous users must not be allowed to access MyWebService.

l All the users except User1 and User2 must be allowed to access MyWebService.

David configures Internet Information Services (IIS) to meet these requirements.

Which of the following code will David use to configure the authorization section of the Web.config file for MyWebService?

  • A . <authorization>
    <deny users="GenTechUser1, GenTechUser2">
    <allow users=”*”>
    <deny users="?">
    </authorization>
  • B . <authorization> <allow users="*">
    <deny users="GenTechUser1, GenTechUser2"> <deny users="?">
    </authorization>
  • C . <authorization>
    <deny users="GenTechUser1, GenTechUser2">
    <deny users="?">
    <allow users="*">
    </authorization>
  • D . <authorization>
    <deny users="GenTechUser1, GenTechUser2">
    <allow users="*">
    </authorization>
  • E . <authorization> <allow users="*">
    <deny users="GenTechUser1, GenTechUser2"> </authorization>

Reveal Solution Hide Solution

Correct Answer: C
Question #56

Which of the following provide simplified access to ASP.NET AJAX login, roles, and profile services from Windows Forms and WPF applications?

  • A . Entity Framework
  • B . AJAX application services
  • C . Client application services
  • D . Sync Framework

Reveal Solution Hide Solution

Correct Answer: C
Question #57

You work as a Software Developer for InfoTech Inc. You create a Windows form in a Windows-based application named MyWinApp1. You use graphics in the form.

You write the following code in your form:

private void MyMouseEvent1(object sender1, MouseEventArgs event)

{

// Code to handle mouse events

}

You want to implement a property of the MouseEventArgs object. This property will return a Point structure that contains the x-coordinate and y-coordinate of the mouse.

Which of the following properties of the MouseEventArgs object will you use to accomplish this?

  • A . Y
  • B . Delta
  • C . Location
  • D . Button
  • E . Clicks
  • F . X

Reveal Solution Hide Solution

Correct Answer: C
Question #58

You work as a Software Developer for ABC Inc. The company uses Visual Studio .NET as its application development platform. You create a class library using the .NET Framework. The library will be used to open the NSCs of computers. Later, you will set up the class library to the GAC and provide it Full Trust permission.

You write down the following code segments for the socket connections:

SocketPermission permission = new SocketPermission(PermissionState.Unrestricted);

permission.Assert();

A number of the applications that use the class library may not have the necessary permissions to open the network socket connections. Therefore, you are required to withdraw the assertion.

Which of the following code segments will you use to accomplish the task?

  • A . permission.PermitOnly();
  • B . CodeAccessPermission.RevertDeny();
  • C . permission.Deny();
  • D . CodeAccessPermission.RevertAssert();
  • E . permission.Demand();

Reveal Solution Hide Solution

Correct Answer: D
Question #59

Which of the following classes will you use to specify that a string must be centered when drawn?

  • A . StringAlignment
  • B . StingFormat
  • C . String
  • D . LineAlignment

Reveal Solution Hide Solution

Correct Answer: B
Question #60

All of the following are benefits for query expressions allowed by Language-integrated query except for which one?

  • A . Rich metadata
  • B . Compile-time syntax checking
  • C . Static typing and IntelliSense
  • D . Imperative code

Reveal Solution Hide Solution

Correct Answer: D

Question #61

You work as a Software Developer for ABC Inc. The company uses Visual Studio.NET 2005 as its application development platform. You are creating an application using .NET Framework 2.0. The application will be used by school children to read a sequential chain of characters.

What will you do to accomplish this task?

  • A . Use the File class.
  • B . Use the TextWriter class.
  • C . Use the TextReader class.
  • D . Use the BinaryReader class.

Reveal Solution Hide Solution

Correct Answer: C
Question #62

Which of the following is required to be implemented by marshal-by-value objects to implement custom serialization rules?

  • A . ISerializable
  • B . SerializableAttribute
  • C . ISerializableAttribute
  • D . ISerialize

Reveal Solution Hide Solution

Correct Answer: A
Question #63

You work as a Software Developer for ABC Inc. The company uses Visual Studio .NET 2008 as its application development platform. You create an ASP.NET Web application using .NET Framework 3.5.

The application rarely experiences errors that cannot be reproduced on a test environment.

You are required to ensure that the application meets the following requirements:

l All unanticipated errors are logged.

l Logging is configured with a least amount of alteration to the application code.

What will you do?

  • A . Override the base class for all forms in the application to add the Try/Catch blocks to all the major functionalities.
  • B . Enable the <customErrors> element in the Web.config file and set the mode attribute to On .
  • C . Enable the <customErrors> element in the Web.config file and set the mode attribute to RemoteOnly.
  • D . Add an event handler for the Application.Error event to the Global.asax file of the applicatio n.

Reveal Solution Hide Solution

Correct Answer: D
Question #64

You can use LINQ in an ASP.NET application through the LinqDataSource control, the __________ control, or by creating LINQ queries.

  • A . ADO.NET DataSet
  • B . ObjectDataSource
  • C . SqlDataSource
  • D . XmlDataSource

Reveal Solution Hide Solution

Correct Answer: B
Question #65

Allen works as a Software Developer for ManSoft Inc. He develops an application using Visual Studio .NET 2005. Only the employees of the company use the application. Allen wants to ensure that when a request on a page is made by a user the application asks for his authentication.

Which of the following actions will Allen take to accomplish the task? Each correct answer represents a part of the solution. Choose two.

  • A . Specify User.Identity to authenticate the user.
  • B . Set the impersonate attribute of the <identity> element to true.
  • C . Specify the username and password attributes.
  • D . Set the impersonate attribute of the <identity> element to false.

Reveal Solution Hide Solution

Correct Answer: B,C
Question #66

Sam works as a Software Developer for GenTech Inc. He creates an ASP.NET page, named Page1, for a college Web site. Page1 is used to enroll new applicants to a certification course offered by the college. In order to get admission to the course, an applicant’s age must be between eighteen and twenty-five. The page contains several TextBox controls that are used by applicants to feed their personal details. The data entered by each applicant is then used to check the eligibility of the applicant.

One of the TextBox controls on the page is named txtDateofBirth. Sam wants to verify that the applicants meet the age requirement. He wants to perform validation both on the server-side and on the client-side. In order to validate the age, he adds a CustomValidator control, named CValidator, to the page and sets its ControlToValidate property to txtDateofBirth.

Which of the following will Sam use to accomplish the task? Each correct answer represents a part of the solution. Choose all that apply.

  • A . ClientValidationFunction event
  • B . ServerValidate property
  • C . ServerValidate event
  • D . ClientValidationFunction property

Reveal Solution Hide Solution

Correct Answer: C,D
Question #67

Which of the following utilities is used to encrypt credentials and session state connection strings?

  • A . Aximp.exe
  • B . Aspnet_regiis.exe
  • C . Aspnet_compiler.exe
  • D . Aspnet_setreg.exe

Reveal Solution Hide Solution

Correct Answer: D
Question #68

You work as a Web Application Developer for ABC Inc. The company uses Visual Studio .NET as its application development platform. You create a Web application using .NET Framework 2.0. You add a Web Form that contains a button named bCancel. The button allows users to exit the form. When users click the button, validation should not occur. However, during testing you find that clicking the button does not allow users to exit the form. You need to ensure that users can always exit the page.

What will you do?

  • A . Set the CausesValidation property of the bCancel button to false.
  • B . Set the AccessibleName property of the validation controls on the Web Form to "false".
  • C . Set the ControlToValidate property of the validation controls on the Web Form to the ID of the control.
  • D . Set the Enabled property of the validation controls on the Web Form to false.

Reveal Solution Hide Solution

Correct Answer: A
Question #69

You work as a Software Developer for ManSoft Inc. You use C# .NET to create an assembly named TestAssembly that will be used by other applications, including a standard COM client application. You must deploy the assembly on the COM application to a client computer. You must ensure that the COM applications can instantiate components within the assembly as COM components.

Which of the following options will you use to accomplish this task?

  • A . Generate a registry file for the assembly by using the Assembly Registration Tool (Regasm.exe) and register the file on the client computer.
  • B . Deploy the assembly to the global assembly cache on the client computer.
    Add a reference to the assembly in the COM client application.
  • C . Create a strong name of the assembly by using the Strong Name tool (Sn.exe).
  • D . Generate a type library for the assembly by using the Type Library Importer (Tlbimp.exe) and register the file on the client computer.

Reveal Solution Hide Solution

Correct Answer: A
Question #70

John works as a Software Developer for Blue Well Inc. He wants to create a class named

Class1 and implements the generic IComparable interface.

He writes the following code:

public class Class1 : System.IComparable<Class1>

{

}

However, John needs to compare one object of Class1 with another object.

Which of the following code statement will John include in his application?

  • A . public int CompareTo(object obj){}
  • B . public object CompareTo(int obj){}
  • C . public object CompareTo(Class1 obj){}
  • D . public int CompareTo(Class1 obj){}

Reveal Solution Hide Solution

Correct Answer: D

Question #71

Allen works as a Software Developer for ABC Inc. The company uses Visual Studio .NET 2005 as its application development platform. Allen creates an application that will be used to handle security information related to the company. He wants to secure the application by using the most secure authentication method. The method should have a strong key for encryption and send the encrypted password across the network.

Which of the following authentication methods will Allen use to accomplish the task?

  • A . Integrated Windows authentication
  • B . Basic authentication
  • C . Certificate-based authentication
  • D . Digest authentication

Reveal Solution Hide Solution

Correct Answer: C
Question #72

Which of the following is a restriction operator in LINQ?

  • A . GROUPBY
  • B . WHERE
  • C . THENBY
  • D . SELECTMANY

Reveal Solution Hide Solution

Correct Answer: B
Question #73

Which of the following options is not a primary objective of the WS-Security 1.1 specification?

  • A . Integrity
  • B . Confidentiality
  • C . Authentication
  • D . Validation

Reveal Solution Hide Solution

Correct Answer: D
Question #74

Allen works as a Software Developer for ABC Inc. The company uses Visual Studio.NET as its application development platform. He creates an application using .NET Framework. He wants to encrypt all his e-mails that he sends to anyone.

Which of the following will he use to accomplish the task?

  • A . PPP
  • B . FTP
  • C . PPTP
  • D . PGP

Reveal Solution Hide Solution

Correct Answer: D
Question #75

Andrew works as a Software Developer for Mansoft Inc. The company’s network has a Web server that hosts the company’s Web site. Andrew wants to enhance the security of the Web site by implementing Secure Sockets Layer (SSL).

Which of the following types of encryption does SSL use? Each correct answer represents a complete solution. Choose two.

  • A . Symmetric
  • B . Secret
  • C . IPSec
  • D . Asymmetric

Reveal Solution Hide Solution

Correct Answer: A,D
Question #76

Which class allows checks against the active principal using the language constructs defined for the declarative and imperative security actions?

  • A . IPrincipal
  • B . CodeAccessPermission
  • C . PrincipalPermission
  • D . SecurityPermission

Reveal Solution Hide Solution

Correct Answer: C
Question #77

Which of the following APIs is used to collect information about any running state and any errors that occur within an ASP.NET application?

  • A . Profile API
  • B . Health Monitoring API
  • C . Error Handling API
  • D . Personalization API

Reveal Solution Hide Solution

Correct Answer: B
Question #78

You work as a Software Developer for ABC Inc. The company uses Visual Studio .NET as its application development platform. You create a class library using the .NET Framework. The library will be used to open the NSCs of computers. Later, you will set up the class library to the GAC and provide it Full Trust permission.

You write down the following code segments for the socket connections:

SocketPermission permission = new SocketPermission(PermissionState.Unrestricted);

permission.Assert();

A number of the applications that use the class library may not have the necessary permissions to open the network socket connections. Therefore, you are required to withdraw the assertion.

Which of the following code segments will you use to accomplish the task?

  • A . permission.PermitOnly();
  • B . CodeAccessPermission.RevertDeny();
  • C . permission.Deny();
  • D . CodeAccessPermission.RevertAssert();
  • E . permission.Demand();

Reveal Solution Hide Solution

Correct Answer: D
Question #79

You work as a Software Developer for Hi-Tech Inc. You develop an application using Visual Studio .NET 2005. You create an unregistered COM DLL file named Com1.dll. You want to use this Com1.dll file in your application code. However, Com1.dll needs to be registered in the Windows Registry before it is used by the application.

Which of the following tools will you use to accomplish the task?

  • A . Wsdl.exe
  • B . Regsvr32.exe
  • C . Tlbimp.exe
  • D . Disco.exe

Reveal Solution Hide Solution

Correct Answer: B
Question #80

Allen works as a Software Developer for ABC Inc. He creates an application using Visual Studio .NET 2005. He wants to ensure that the application must manage state effectively. State is how data is moved and persisted throughout the layers of the application. There are number of factors to validate state management.

Which of the following factors will he consider to accomplish the task? Each correct answer represents a part of the solution. Choose all that apply.

  • A . State persistence
  • B . Saving state
  • C . Caching
  • D . Shared state
  • E . View state

Reveal Solution Hide Solution

Correct Answer: A,B,C,D

Question #81

Allen works as a Software Developer for ABC Inc. The company uses Visual Studio.NET as its application development platform. He creates an application using .NET Framework. He wants to encrypt all his e-mails that he sends to anyone.

Which of the following will he use to accomplish the task?

  • A . PPP
  • B . FTP
  • C . PPTP
  • D . PGP

Reveal Solution Hide Solution

Correct Answer: D
Question #82

You work as a Software Developer for ABC Inc. The company uses Visual Studio .NET 2008 as its application development platform. You have recently finished the development of an ASP.NET Web application using .NET Framework 3.5. The application must be deployed by using the http://www.ABC.com/ URL. The application has several Web forms.

You need to implement Really Simple Syndication (RSS) feeds functionality. The RSS feeds will be used by the http://www.ABC.com/Updates.rss URL. You must ensure that the application displays the RSS-formatted information when accessing the given URL.

What will you do to accomplish this? Each correct answer represents a part of the solution. Choose two.

  • A . Create and register a custom HttpHandler class that releases the RSS feeds.
  • B . Create a Web form named Updates that releases the RSS feeds.
  • C . Create an ASMX Web service component named Updates.
  • D . Add the HttpHandler class to the .rss extension.
  • E . Create and register a custom HttpModule class.

Reveal Solution Hide Solution

Correct Answer: A,D
Question #83

You work as a Software Developer for ManSoft Inc. You use Microsoft Visual Studio to create a Web service named MyWebService. You create a SOAP message that is not secure in the Web service. You want to use the SendSecurityFilter class in the Web service to handle the transmission and securing of SOAP messages.

Which of the following code segments will you use to accomplish the task? Each correct answer represents a part of the solution. Choose all that apply.

  • A . public class MySendSecurityFilter : SendSecurityFilter
    {
    public MySendSecurityFilter(string service, Boolean client)
    { }
    public override void SecureMessage(SoapEnvelope envelope, Security security) {
    // Implement validation here
    }
    }
  • B . public class MySendSecurityFilter : SendSecurityFilter
    {
    public MySendSecurityFilter(string service, Boolean client)
    {
    base(service,client);
    }
    public override void SecureMessage(SoapEnvelope envelope, Security security)
    {
    // Implement validation here
    }
    }
  • C . public class MySendSecurityFilter : SendSecurityFilter
    {
    public MySendSecurityFilter(string service, Boolean client) : base(service,client) { }
    public override void SecureMessage(SoapEnvelope envelope, Security security) {
    // Implement validation here
    }
    }
  • D . public class MySendSecurityFilter : SendSecurityFilter
    {
    public MySendSecurityFilter(string service, Boolean client) : base(service,client) { }
    public void SecureMessage(SoapEnvelope envelope, Security security)
    {
    // Implement validation here
    }
    }

Reveal Solution Hide Solution

Correct Answer: B,C
Question #84

Which of the following is a reference type in Visual C#?

  • A . primitive types
  • B . strings
  • C . enums
  • D . structures

Reveal Solution Hide Solution

Correct Answer: B
Question #85

You work as a Software Developer for ABC Inc. The company has several branches worldwide. The company uses Visual Studio.NET 2005 as its application development platform. You have recently finished the development of an application using .NET Framework 2.0. The application can be used only for cryptography. Therefore, you have implemented the application on a computer.

What will you call the computer that implemented cryptography?

  • A . Cryptographic toolkit
  • B . Cryptosystem
  • C . Cryptographer
  • D . Cryptanalyst

Reveal Solution Hide Solution

Correct Answer: B
Question #86

You work as a Software Developer for ABC Inc. The company uses Visual Studio .NET 2008 as its application development platform. You are creating a custom control library using .NET Framework 3.5. Developers will use this custom control on Web pages in multiple applications. Each and every ASP.NET application will be configured by using different state management approaches. You have to ensure consistent state management for all instances of the custom control.

Which of the following states will you use to accomplish this task?

  • A . Session state
  • B . Application state
  • C . Control state
  • D . View state

Reveal Solution Hide Solution

Correct Answer: C
Question #87

The <customErrors> element does not apply to errors that occur in __________.

  • A . XML Web services
  • B . Windows services
  • C . Web services directory
  • D . Web services

Reveal Solution Hide Solution

Correct Answer: A
Question #88

Which of the following is not a method of controlling traffic through a firewall?

  • A . Application filtering
  • B . Encryption-level filtering
  • C . Stateful inspection
  • D . Packet filtering

Reveal Solution Hide Solution

Correct Answer: B
Question #89

You work as a Software Developer for ABC Inc. The company uses Visual Studio .NET 2005 as its application development platform. You are creating an application using .NET Framework 2.0. The application uses serialization to allow users to take an instance of an object and convert it into a format that can be easily transmittable over the network or even stored in a database. You want to provide the base functionality for the common language runtime serialization formatters.

Which of the following classes will you use to accomplish the task?

  • A . SoapFormatter
  • B . FormatterConverter
  • C . Formatter
  • D . BinaryFormatter

Reveal Solution Hide Solution

Correct Answer: C
Question #90

You work as a Software Developer for ABC Inc. The company uses Visual Studio .NET 2008 as its application development platform. You are creating an ASP.NET Web application using .NET Framework 3.5. The application will be used to share any type of photos on Internet. All the photos should be accessible in various sizes and formats. You need to add a download feature that can be easily maintained. You also need to make sure that only a single version of all photos is stored on a SQL server database.

What will you do?

  • A . Create an HttpModule class to determine the request for the photo download. Process the photo according to the given format and size, and after that return the processed photo in the response.
  • B . Create a user control that converts the photo to the required format and size.
  • C . Create an HttpHandler class to determine the request for the photo download. Process the photo according to the given format and size, and after that return the processed photo in the response.
  • D . Create an ActiveX control that converts the photo to the required format and size.

Reveal Solution Hide Solution

Correct Answer: C

Question #91

In .NET Framework 3.5, you can create and access values that persist from one application session to another.

What are these values called?

  • A . Objects
  • B . Settings
  • C . Properties
  • D . Attributes

Reveal Solution Hide Solution

Correct Answer: B
Question #92

Which of the following modes can be used to configure the Remote Debugging Monitor for remote debugging?

  • A . Password Authentication
  • B . Form Authentication
  • C . No Authentication
  • D . SQL Server Authentication

Reveal Solution Hide Solution

Correct Answer: C
Question #93

Peter works as a Software Developer for NessCom Inc. He creates a Web application named WebApp using Visual Studio .NET. WebApp contains an .aspx page named DataValidatePage.aspx, which has several Web server controls. Two TextBox controls, txtProdID and txtProdName, are used. The txtProdID control is used to enter the identification number of the products used by the company. The txtProdName control is used to enter valid product names. Peter wants to ensure that only valid data is entered in these two TextBox controls. Therefore, he implements a RequiredFieldValidator class in the DataValidatePage.aspx page. Choose the appropriate actions Peter will perform to accomplish the task.

  • A .

Reveal Solution Hide Solution

Correct Answer: A
Question #94

You work as a Software Developer for ABC Inc. The company uses Visual Studio.NET 2008 as its application development platform. You have recently finished development of an ASP.NET Web application using the .NET Framework 3.5. You host the application on a Web farm that consists of three Web servers.

You should configure the ASP.NET application for session state to meet the following requirements:

l Session state data should not be lost if a server fails.

l Session state must be maintained across browser requests by the same user.

You are required to configure the Web.config file to meet these requirements.

Which of the following configurations will you use?

  • A . <sessionState mode="StateServer"/>
  • B . <sessionState mode="InProc"/>
  • C . <sessionState mode="Custom"/>
  • D . <sessionState mode="SQLServer"/>

Reveal Solution Hide Solution

Correct Answer: D
Question #95

You work as a Software Developer for ABC Inc. You develop an application using Visual Studio .NET 2005. You want to print the contents of a document named MyFile1.doc located on the local computer. Therefore, you use the printing controls in the application.

Which of the following events will you use in the application code to accomplish the task?

  • A . EndPrint
  • B . QueryPageSettings
  • C . PrintPage
  • D . BeginPrint

Reveal Solution Hide Solution

Correct Answer: C
Question #96

Maria works as a Software Developer for BlueWell Inc. She develops an application, named App1, using Visual C# .NET. The application displays employee details from a SQL Server database. Maria wants to use a string array , named MyArray, in the application code to store employee names.

Which of the following statements will she use to declare MyArray?

  • A . Option Base 1 string[] MyArray = new string[9];
  • B . string[] MyArray = new string[9];
  • C . Option Base 0 string[] MyArray = new string[9];
  • D . string[] MyArray = new string[0 to 9];
  • E . string MyArray[9] = new string;

Reveal Solution Hide Solution

Correct Answer: B
Question #97

John works as a Software Developer for CyberTech Inc. He creates an ASP .NET page named BookItemList.aspx, which displays a price list of computer books. Registered users have to first log on to the company’s Web site in order to view the current price list of different computer books available on the Web site. Users want to maintain the page requests as long as they are accessing the Web page.

John wants to ensure that whenever the Web page BookItemList.aspx is posted back to the server, the price list should not be changed on the registered user’s computer. He also wants to validate the page sent back to the server.

Which of the following actions will John take to accomplish the task? Each correct answer represents a part of the solution. Choose two.

  • A . Set the EnableEventValidation attribute to false.
  • B . Set the EnableEventValidation attribute to true.
  • C . Set the EnableViewState attribute to true.
  • D . Set the EnableViewState attribute to false.

Reveal Solution Hide Solution

Correct Answer: B,C
Question #98

Mark works as a Software Developer for GenTech Inc. He develops an application, named App1, using Visual Studio .NET. The application contains a Form control, named Form1, which enables users to edit information in a SQL Server database. Mark wants to save all the changes made by users in the database. He defines a boolean variable, named DataIsSaved, in the application code. DataIsSaved indicates whether or not all data are saved in the database. Mark wants to prevent Form1 from closing until all the changes are saved in the database.

Which of the following code will he use to accomplish this?

  • A . protected void Form1_Leave(object sender, System.ComponentModel.CancelEventArgs
    e) {
    if(!DataIsSaved)
  • B . Cancel = false; else
  • C . Cancel = true;
    }
  • D . protected void Form1_Leave(object sender, System.ComponentModel.CancelEventArgs
    e) {
    if(!DataIsSaved)
  • E . Cancel = true; else
  • F . Cancel = false;
    }
  • G . protected void Form1_Closed(object sender, System.ComponentModel.CancelEventArgs e) { if(!DataIsSaved)
  • H . Cancel = false; else
  • I . Cancel = true;
    }
  • J . protected void Form1_Closing(object sender, System.ComponentModel.CancelEventArgs e) { if(!DataIsSaved)
  • K . Cancel = false; else
  • L . Cancel = true;
    }
  • M . protected void Form1_Closed(object sender,
    System.ComponentModel.CancelEventArgs e) {
    if(!DataIsSaved)
  • N . Cancel = true;
    else
  • O . Cancel = false;
    }
  • P . protected void Form1_Closing(object sender,
    System.ComponentModel.CancelEventArgs e) {
    if(!DataIsSaved)
  • Q . Cancel = true;
    else
  • R . Cancel = false;
    }

Reveal Solution Hide Solution

Correct Answer: F
Question #99

John works as a Web Developer for ABC Inc. He develops an ASP.NET application, named MyApp1, using Visual Studio .NET. The application will be used in the Sales department to generate monthly reports. John wants to deploy the application on the company’s intranet. The company uses Microsoft Windows authentication. John wants to deny access to all the members of the Guest1 role.

Which of the following attributes will he use in the < authorization > element of the application’s Web.config file to accomplish the task?

  • A . <deny roles="Guest1" />
  • B . <deny="Guest1" />
  • C . <deny users="Guest1" />
  • D . <deny users=Guest1("All") />

Reveal Solution Hide Solution

Correct Answer: A
Question #100

You work as an Enterprise Application Developer for SunInfo Inc. The company uses Visual Studio 2008 as its application development platform. You create a Windows Forms

application using .NET Framework 3.5. You want to notify the users when a print job has finished.

Which of the following events will you use to accomplish the task?

  • A . PrintDocument.PrintPage
  • B . PrintDocument.EndPrint
  • C . PrintDocument.QueryPageSettings
  • D . PrintDocument.BeginPrint

Reveal Solution Hide Solution

Correct Answer: B
Exit mobile version