Summer Special Flat 65% Limited Time Discount offer - Ends in 0d 00h 00m 00s - Coupon code: netdisc

GIAC GSSP-NET-CSHARP GIAC GIAC Secure Software Programmer - C#.NET Exam Practice Test

GIAC GIAC Secure Software Programmer - C#.NET Questions and Answers

Testing Engine

  • Product Type: Testing Engine
$43.75  $124.99

PDF Study Guide

  • Product Type: PDF Study Guide
$38.5  $109.99
Question 1

You work as a Software Developer for ABC Inc. The company uses Visual Studio .NET as its application development platform. You are creating a Windows service application using the .NET Framework. The service is used to execute several tasks that require background processing. You do not want to actively manage threads in the service application, but you must make sure that security checks are performed during the execution of the task. What will you do to accomplish the task?

Options:

A.

Use the ThreadPool.UnsafeQueueUserWorkItem method.

B.

thread2 raises its own priority

C.

Use the Thread.Start method.

D.

Use the Thread.Resume method.

E.

Use the ThreadPool.QueueUserWorkItem method.

Question 2

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?

Options:

A.

RangeValidator

B.

RequiredFieldValidator

C.

CustomValidator

D.

RegularExpressionValidator

Question 3

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. You are using regular expression in the application to validate email, phone number, etc. You are required to match the preceding character or sub expression zero or more times. Which of the following wildcard characters will you use to accomplish the task?

Options:

A.

?

B.

+

C.

*

D.

[n]

Question 4

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. The application contains a class named globalInfo. You need to serialize all public and nonpublic data of the globalInfo class to ensure that the class generates the minimum byte stream so that the minimum load is placed upon network resources. What will you do?

Options:

A.

Use the XmlSerializer class.

B.

Use the BinaryFormatter class.

C.

Use the SoapFormatter class.

D.

Use the IXmlSerializable interface.

Question 5

You work as a Software Developer for ABC Inc. The company uses Visual Studio .NET 2005 as its application development platform. You create an application named MyApplication. MyApplication uses the System.IO namespace. You want to ensure that you are able to use a class that specifies read and write operations either in synchronous or asynchronous manner. Which of the following classes will you use to accomplish the task?

Options:

A.

StreamReader

B.

FileStream

C.

StreamWriter

D.

MemoryStream

Question 6

Andrew works as a Software Developer for BlueWell Inc. He develops a Windows-based application, named App1, using Visual Studio .NET. The application uses Microsoft SQL Server as a backend database. Andrew wants to perform security checks on App1. Which of the following statements regarding security checks are true?

Each correct answer represents a complete solution. Choose two.

Options:

A.

Declarative security check works by instantiating security classes.

B.

Declarative security check works by assigning attributes to assemblies.

C.

Imperative security check works by instantiating security classes.

D.

Imperative security check works by assigning attributes to assemblies.

Question 7

You work as a Software Developer for ABC Inc. You are defining a component for an application. In some deployments, the component will be deployed on the same computer as the application. In other deployments the component will be deployed on a separate computer. The component has implicit dependencies and needs to access and use server-side resources that cannot cross system boundaries.

You must ensure that your component design supports both deployment scenarios. What will you do to accomplish the task?

Options:

A.

Create a SingleCall object.

B.

Create a marshal-by-value object.

C.

Create a marshal-by-reference object.

D.

Create a Singleton object.

Question 8

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 .NET Framework 3.5. You deploy the application on a test server and enable the debugging. The application is hosted in IIS 6.0 and uses the default authentication. Integrated

Windows authentication is enabled and anonymous access is disabled. You have not got the administrative rights on the test server. The following configuration is present in the Web.config filE.

<authorization>

You are required to configure the Web.config file to debug the application from your development computer. Which of the following configurations will you use in the Web.config file?

Options:

A.

B.

C.

<authorization>

D.

<authorization>

Question 9

Sam works as a Software Developer for BlueWell Inc. He creates a .NET Remoting object named MyObj using Visual Studio .NET. He wants to configure MyObj to send and receive confidential information from an XML file stored in an encrypted hard drive. What will he do to accomplish the task?

Each correct answer represents a part of the solution. Choose two.

Options:

A.

Implement a declarative security check.

B.

Implement an imperative security check.

C.

Use the SecurityAction.Demand value for the SecurityAction flag.

D.

Use the SecurityAction.RequestMinimum value for the SecurityAction flag.

Question 10

You work as an Enterprise Application Developer for ABC Inc. The company uses Visual Studio .NET 2008 as its application development platform. You are creating an Enterprise application using .NET Framework 3.5. The application must meet the following requirements:

l The application loads XML from streams.

l The application creates XML from scratch by using functional construction.

l The application queries XML using XPath-like axes.

l The application validates XML trees using XSD.

What will you do to meet these requirements with least development efforts?

Options:

A.

Use LINQ to XML.

B.

Use LINQ to SQL.

C.

Use the XML Schema Definition Tool.

D.

Use ADO.NET Data Services.

Question 11

John works as a Web Developer for ProLabs Inc. He develops an ASP.NET application, named

MyWebApp1, using Visual Studio .NET. One of the pages in the application is named as Page1.aspx, which does not need to maintain session state. To improve the performance of the application, John wants to disable session state for Page1. Which of the following actions will he take to accomplish the task?

Options:

A.

Set the EnableViewState attribute in the @ Page directive to false.

B.

Set the DisableSessionState attribute in the @ Page directive to true.

C.

In the sessionState configuration section of the application's Web.config file, set the mode attribute to off.

D.

Set the EnableSessionState attribute in the @ Page directive to false.

Question 12

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

You are required to use a datatype that will store only numbers ranging from -32,768 to 32,767.

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

Each correct answer represents a complete solution. Choose two.

Options:

A.

int

B.

string

C.

short

D.

System.Int16

Question 13

Maria works as a Software Developer for BlueWell Inc. She develops an application, named App1, using Visual C# .NET. App1 contains a Form control, named Form1, for collecting users' contact information. Form1 contains a TextBox control, named TextBox1. App1 requires users to enter data in TextBox1. Maria writes a method, named Method1, to validate the entered data. She adds an ErrorProvider control, named Control1, to Form1. Maria wants to ensure that App1 notifies the users if they enter invalid data in TextBox1. Which of the following code will she use to accomplish this?

Options:

A.

public void TextBox1_Validating(object sender, System.CancelEventArgs e)

{

if(Method1() == false)

{

Control1.UpdateBinding();

}

}

B.

public void TextBox1_Validating(object sender, System.ComponentModel.CancelEventArgs e)

{

if(Method1() == false)

{

Control1.SetError(TextBox1, "Invalid Email Entry.");

}

}

C.

public void TextBox1_Validated(object sender, System.ComponentModel.CancelEventArgs e)

{

if(Method1() == false)

{

Control1.UpdateBinding();

}

}

D.

public void TextBox1_Validated(object sender, System.ComponentModel.CancelEventArgs e)

{

if(Method1() == false)

{

Control1.SetError(TextBox1, "Invalid Email Entry.");

}

}

Question 14

Mark works as a Software Developer for TechBook Inc. He develops an ASP.NET application, named MyApp1, using Visual Studio .NET. MyApp1 contains an ASP.NET page that is used to register new participants to a quiz contest, which is to be held recently in the city of New York. In order to take part in the quiz contest, an applicant must be between the age of fifteen and twenty-five. Mark adds a TextBox control, named txtDateOfBirth, to the page. He wants to ensure that each prospective participant enters his date of birth in txtDateOfBirth. He also wants to verify that prospective participants meet the age requirement. For this, Mark wants to use a custom client script function. He also wants to minimize the number of trips made to the server. Which of the following actions will Mark perform to accomplish the task?

Each correct answer represents a part of the solution. Choose all that apply.

Options:

A.

Add a RequiredFieldValidator control to the page. Set its ControlToValidate property to txtDateOfBirth.

B.

Set the ClientValidationFunction property of the CustomValidator control to the name of the script function that performs the client-side validation.

C.

Set the AutoPostBack property of txtDateOfBirth to True.

D.

Add a CustomValidator control to the page. Set its ControlToValidate property to txtDateOf Birth.

E.

Set the ClientValidationFunction property of txtDateOfBirth to the name of the script function that performs the client-side validation.

F.

Set the AutoPostBack property of txtDateOfBirth to False.

Question 15

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?

Options:

A.

Copy the serviced component assembly into the C.\Program Files\ComPlus Applications fold er

B.

Run the command line tool: regasm.exe myservices.dll.

C.

Copy the serviced component assembly into the C.\WINDOWS\system32\Com folder.

D.

Run the command line tool: gacutil.exe /i myservices.dll.

Question 16

You work as a Software Developer for Mansoft Inc. The company uses Visual Studio.NET 2005 as its application development platform. You need to write a code segment that can change the file extension of a file named Test.txt. Which of the following code segments will you choose to change the file extension?

Each correct answer represents a complete solution. Choose two.

Options:

A.

using System;

using System.IO;

public class ChangeExample

{

public static void Main()

{

string FileName =@"C.\Test.txt";

Console.Write ("File NamE."+FileName);

Console.Write (" File Extension: {0}", Path.GetExtension(FileName));

Console.Write ("Change File Extension {0}", Path.ChangeExtension(FileName, "doc"));

}

}

B.

using System;

using System.IO;

public class ChangeExample

{

public static void Main()

{

string FileName =@"C.\Test.txt";

Console.Write ("File NamE."+FileName);

Console.Write (" File Extension: {0}", Path.GetExtension(FileName));

Console.Write ("Change File Extension {0}", Path.ChangeExtension(FileName,".exe"));

}

}

C.

using System;

using System.IO;

public class ChangeExample

{

public static void Main()

{

string FileName =@"C.\Test.txt";

Console.Write ("File NamE."+FileName);

Console.Write (" File Extension: {0}", Path.GetExtension(FileName));

Console.Write ("Change File Extension {0}", Path.ChangeExtension(FileName));

}

}

D.

using System;

using System.IO;

public class ChangeExample

{

public static void Main()

{

string FileName =@"C.\Test.txt";

Console.Write ("File NamE."+FileName);

Console.Write (" File Extension: {0}", Path.GetExtension(FileName));

Console.Write ("Change File Extension {0}", Path.ChangeExtension("rft"));

}

}

Question 17

Sam works as a Software Developer for SamTech Inc. He creates an XML Web service, named

WebService1, using Visual Studio .NET. WebService1 uses the .NET Framework security class libraries to implement security. It implements role-based authorization based on a SQL Server database containing user names. Sam adds the following statements to the Web service codE. using System.Security.Principal; using System.Threading;

Sam wants to ensure that only validated users are permitted to access WebService1 by entering their user names and passwords in TextBox controls, named Text1 and Text2. He wants to implement imperative security check on WebService1. He also wants to ensure that users are assigned the Manager role and the Subordinate role by default. Which of the following classes will Sam use to accomplish the task?

Each correct answer represents a part of the solution. Choose two.

Options:

A.

WindowsPrincipal

B.

GenericIdentity

C.

WindowsIdentity

D.

GenericPrincipal

Question 18

Kathy works as a Software Developer for BlueWell Inc. She creates a serviced component named

Com1. She wants to ensure that all the employees of the company are able to use Com1. Therefore, she wants to install Com1 in the Global Assembly Cache (GAC). Before the installation, she wants to register the serviced component manually with COM+. Which of the following tools will Kathy use to register Com1?

Options:

A.

Al.exe

B.

Regsvcs.exe

C.

Regasm.exe

D.

Mscorcfg.msc

Question 19

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. The application contains two HTML pages named Error.htm and

PageNotFound.htm. You want to make sure that the following requirements are met:

l When any user requests a page that does not exist, the PageNotFound.htm page is displayed.

l When any other error occurs, the Error.htm page is displayed.

Which of the following code segments will you add to the Web.config file to accomplish this task?

Options:

A.

B.

C.

D.

Question 20

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.

Options:

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.

Question 21

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?

Options:

A.

permission.PermitOnly();

B.

CodeAccessPermission.RevertDeny();

C.

permission.Deny();

D.

CodeAccessPermission.RevertAssert();

E.

permission.Demand();

Question 22

You work as an Enterprise Application Developer for ABC Inc. The company uses Visual Studio .NET 2008 as its application development platform. You create an application using .NET Framework 3.5. The application represents a WCF service. The service will be consumed by clientside code that runs in the Web pages of an ASP.NET AJAX application. You must ensure that data serialization between the service and the application acquires least amount of latency. Which data format will you use to accomplish this?

Options:

A.

Extensible Application Markup Language

B.

JavaScript Object Notation

C.

Extensible Markup Language

D.

Really Simple Syndication

Question 23

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 need to represent a strongly typed lambda expression as a data structure in the form of an expression tree. Which of the following classes will you use to accomplish the task?

Options:

A.

MethodCallExpression

B.

Expression(TDelegate)

C.

Expression

D.

LambdaExpression

Question 24

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 the .NET Framework 3.5. The application stores sensitive profile data in a MS SQL Server 2008 database. You are required to make sure that the profile data never stored in clear text. What will you do?

Options:

A.

Create a strongly typed custom ProfileProvider class. In the ProfileProvider class, encrypt the provided information before storing it in the database.

B.

Use the ASP.NET IIS Registration Tool to encrypt the connection string to connect to the SQL Server database.

C.

Create a custom profile provider. In the custom provider, encrypt the provided information before storing it in the database.

D.

Enable the SSL encryption for the SQL Server connections.

Question 25

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?

Options:

A.

Integrated Windows authentication

B.

Basic authentication

C.

Certificate-based authentication

D.

Digest authentication

Question 26

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?

Options:

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.

Question 27

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?

Options:

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.

Question 28

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 are not using an exception handling framework in the application. However, the application must automatically log all unhandled exceptions to an event log. You are required to configure the Web.config file accordingly. Which of the following configurations will you use to accomplish the task?

Options:

A.

B.

C.

D.

Question 29

You work as a Software Developer for Mansoft Inc. You create an application and use it to create users as members of the local Users group. Which of the following code snippets imperatively demands that the current user is a member of the local Users group?

Each correct answer represents a complete solution. Choose all that apply.

Options:

A.

System.AppDomain.CurrentDomain.SetPrincipalPolicy(PrincipalPolicy.WindowsPrincipal);

PrincipalPermission MyPermission = new PrincipalPermission(null, @"BUILTIN\Users", true);

MyPermission.Demand();

B.

System.AppDomain.CurrentDomain.SetPrincipalPolicy(PrincipalPolicy.WindowsPrincipal);

PrincipalPermission MyPermission = new PrincipalPermission(null, @"Users", true); MyPermission.Demand();

C.

PrincipalPermission MyPermission = new PrincipalPermission(null, @"BUILTIN\Users", true); MyPermission.Demand();

D.

PrincipalPermission MyPermission = new PrincipalPermission(null, @"Users", true); MyPermission.Demand();

Question 30

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?

Options:

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.

Question 31

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?

Options:

A.

B.

C.

D.

Question 32

Which of the following is not a type of Remote object?

Options:

A.

Server-activated object

B.

Client-activated object

C.

Singleton object

D.

Single call object

Question 33

George works as a Software Developer for GenTech Inc. He creates an application named App1 using Visual Studio .NET. App1 uses the version 2.0.0.0 of an assembly named Assembly1. However, he wants App1 to use a new version i.e. 2.1.0.0 of Assembly1. Therefore, he needs to specify Assembly1's location so that App1 can use version 2.1.0.0 of Assembly1. What will George use to accomplish the task?

Each correct answer represents a complete solution. Choose all that apply.

Options:

A.

An unmanaged code.

B.

A managed code.

C.

The element.

D.

The element.

Question 34

John works as a Web Developer for Bitsoft Inc. He creates an ASP.NET application, named MyApp1, by using Visual Studio .Net for a University Web site. Students will use MyApp1 to view their term end result. MyApp1 contains an ASP.NET page named, named Page1. Page1 contains a TextBox control, named txtEnrolmentNo, and two Button controls, named btnSubmit and btnCancel respectively.

John wants that if a user tries to submit the page by clicking the Submit button without entering his enrolment the word "Required" appears next to txtEnrolmentNo. However, when a user clicks the Cancel button he is redirected to a new page, named PageCancel.aspx. To accomplish this he adds a RequiredFieldValidator control to the page and sets its ControlToValidate and ErrorMessage properties to txtEnrolmentNo and "Required" respectively. However, when he executes the application he finds that the validation check is also performed on clicking the Cancel button. What is the most likely cause of the issue?

Options:

A.

The CauseValidation property of btnSubmit is not set to True.

B.

The CauseValidation property of btnCancel is not set to True.

C.

The CauseValidation property of btnSubmit is not set to False.

D.

The CauseValidation property of btnCancel is not set to False.

Question 35

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

Options:

A.

Objects

B.

Settings

C.

Properties

D.

Attributes

Question 36

Henry works as a Software Developer for SoftTech Inc. He creates a Windows form named

MyForm1. The form contains detailed information about a student. The form uses a ListBox control named ListBox1 that concatenates two strings displayed in two TextBox controls. Henry wants a method to return a value for the control. Which of the following options will he consider while creating a method for the control?

Options:

A.

A method with a string return type.

B.

A void method that passes only one parameter.

C.

A method with an integer return type.

D.

A void method that passes more than one parameter.

Question 37

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?

Options:

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)

Question 38

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.

Options:

A.

State persistence

B.

Saving state

C.

Caching

D.

Shared state

E.

View state

Question 39

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?

Options:

A.

Match

B.

Matches

C.

Equals

D.

IsMatch

Question 40

You work as a Windows Application Developer for ABC Inc. The company uses Visual Studio .NET as its application development platform. You create a Windows application using the .NET Framework. You create a Semaphore class instance in the application by using the following code snippet:

Semaphore tSema = new Semaphore(0, 5);

...

tSema.Release(6);

What will the above code segment do?

Options:

A.

It will set the maximum count for the semaphore to 6.

B.

It will set the initial count for the semaphore to 5.

C.

It will throw a SemaphoreFullException.

D.

It will throw a ThreadAbortException.

Question 41

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. The application uses Session objects. You are changing the application to run on a Web farm. You want to make sure that the application can access the Session objects from all the servers in the Web farm. You also make sure that when any server in the Web farm restarts or stops responding, the Session objects are not lost. What will you do?

Options:

A.

Use InProc Session Management mode to store session data in the ASP.NET worker process

B.

Use StateServer Session Management mode to store session data in a common State Server process on a Web server in the Web farm

C.

Use SQLServer Session Management mode to store session data in an individual database for each Web server in the Web farm

D.

Use SQLServer Session Management mode to store session data in a common Microsoft SQL Server 2005 database

Question 42

You work as a Software Developer for Blue Well Inc. You create a mobile Web application for mobile users. You want to ensure that a cookieless session is implemented on it. Which of the following statements are the main reasons of implementing a cookieless session on a mobile Web application?

Each correct answer represents a part of the solution. Choose two.

Options:

A.

Tests mobile Web applications

B.

Stores data in Web server memory

C.

Ensures better compatibility with mobile devices

D.

Maintains session state of each user

Question 43

You work as an ADO.NET Application Developer for ABC Inc. The company uses Microsoft Visual Studio .NET 2008 as its application development platform. You create an ADO.NET application by using .NET Framework 3.5. You need to represent a strongly typed lambda expression as a data structure in the form of an expression tree. Which of the following classes will you use to accomplish the task?

Options:

A.

MethodCallExpression

B.

LambdaExpression

C.

Expression

D.

Expression (TDelegate)

Question 44

Which of the following code snippets is an example of tight encapsulation?

Options:

A.

protected int x;

protected void fun(){x=5;}

B.

int x;

public void fun(){x=5;}

C.

public int x;

public void fun() {x=5;}

D.

private int x;

public void fun(){x=5;}

E.

private int x;

private void fun(){x=5;}

Question 45

Ryan works as a Software Developer for Mansoft Inc. He creates an ASP.NET Web application named MyWebApplication using Visual Studio .NET 2005. MyWebApplication performs validation on XML files in a directory. Whenever a new XML file appears in the directory, MyWebApplication opens the file, checks it for validation, and updates it accordingly. Ryan wants to ensure that each update performed on XML files is logged in the Web application log. He creates a String object named Var1, to store the message to be logged. Which of the following will he use to accomplish the task?

Each correct answer represents a part of the solution. Choose two.

Options:

A.

The EventLog.Source property

B.

The EventLog.WriteEntry method

C.

The Trace.WriteLine method

D.

The EventLog.EventLogSource property

Question 46

You work as a Software Developer for ABC Inc. You create a Console application. You write the following code in the application:

RC2CryptoServiceProvider TestRC2 = new RC2CryptoServiceProvider();

Console.WriteLine(TestRC2.Mode);

What output will the above code display?

Options:

A.

Cipher Block Chaining (CBC)

B.

Output Feedback (OFB)

C.

Cipher Text Stealing (CTS)

D.

Electronic Codebook (ECB)

E.

Cipher Feedback (CFB)

Question 47

You work as a Software Developer for ManSoft Inc. The company uses Visual Studio.NET 2005 as its application development platform. You have recently created an application that includes the code shown below.

string str1 = "ABC";

string str2 = "u";

str2 += "Certify";

Console.WriteLine(str1 == str2);

Console.WriteLine((Object) str1 == (Object) str2);

Console.WriteLine(str1.Equals(str2));

What will be the output of the above code?

Options:

A.

True

True

True

B.

True

False

True

C.

False

False

False

D.

False

True

False

Question 48

You work as a Windows Application Developer for ABC Inc. The company uses Visual Studio .NET as its application development platform. You create a Windows application using the .NET Framework. You create a database to maintain the record of the students. You create a table named Student. You want to retrieve names and roll number of those students whose age is less than ten years. An instance of the SqlCommand class named StudentCommand is already created. Which of the following code segments should you use to execute the query?

Options:

A.

StudentCommand.CommandType = CommandType.StoredProcedure;

StudentCommand.CommandText = "SELECT Name, Roll number FROM Student WHERE Age <

10";

B.

StudentCommand.CommandType = CommandType.StoredProcedure;

StudentCommand.CommandText = "Name and Roll number of students less than ten years";

C.

StudentCommand.CommandType = CommandType.Text;

StudentCommand.CommandText = "SELECT Name, Roll number FROM Student WHERE Age <

10";

D.

StudentCommand.CommandText = CommandText.Text;

StudentCommand.CommandType = "SELECT Name, Roll number FROM Student WHERE Age <

10";

Question 49

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?

Options:

A.

Integrated Windows authentication

B.

Basic authentication

C.

Certificate-based authentication

D.

Digest authentication

Question 50

You work as a Software Developer for Mansoft Inc. You create an application and use it to create code access security policies. Which of the following tools will you use to examine and modify code access security policies from a batch file?

Options:

A.

GacUtil.exe

B.

StoreAdm.exe

C.

Caspol.exe

D.

Tlbimp.exe

E.

Sn.exe

Question 51

Roger works as a Software Developer for BlackWell Inc. He develops an application, named MyApplication1, using Visual Studio .NET. The application contains a form, named MyForm1, which will be used to set a password for a user. A password allotted to a user will be case-sensitive. MyForm1 contains several controls including two TextBox controls, named txtPassword and txtConfirm, respectively. The txtMyPassword control is used to accept a string from a user. The string entered in txtPasword will be used as the password for the user. In txtConfirm, the user has to retype the string that he enters in txtPassword. This will ensure that there are no typing errors. MyForm1 also contains a Button control, named cmdSetPassword, which when clicked will set the password for the user.

Before setting the password for a user, Roger wants to ensure that the two text boxes contain the same string. In order to accomplish this, he decides to use the StrComp function. The password for a user can only be set if the StrComp function returns 0. He has not used an Option Compare statement in the code. Which of the following statements can Roger use to compare the two strings?

Each correct answer represents a complete solution. Choose two.

Options:

A.

StrComp(txtPassword.Text, txtConfirm.Text, CompareMethod.Binary)

B.

StrComp(txtPassword.Text, txtConfirm.Text, CompareMethod.Text)

C.

StrComp(txtPassword.Text, txtConfirm.Text, CompareMethod.CaseSensitive)

D.

StrComp(txtPassword.Text, txtConfirm.Text)

Question 52

You work as an ADO.NET Application Developer for ABC Inc. The company uses Microsoft Visual Studio .NET 2008 as its application development platform. You create an ADO.NET application by using .NET Framework 3.5. You are using the System.Linq.Expressions namespace to represent the code expression as objects in the form of expression trees. You want to initialize the members of a newly created object. What will you do to accomplish the task?

Options:

A.

Use the MemberBinding class

B.

Use the UnaryExpression class

C.

Use the MemberBindingType enumeration

D.

Use the MemberListBinding class

Question 53

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 sometimes require a variable number of arguments to be passed to a method. For example, you may require a sum method, which calculates the total of the numbers passed to it no matter how many numbers are passed. What will you do to accomplish the task?

Options:

A.

Use the out keyword.

B.

Use the base keyword.

C.

Use the volatile keyword.

D.

Use the params keyword.

E.

Use the ref keyword.

Question 54

You work as an Application Developer for ABC. The company uses Visual Studio .NET Framework 3.5 as its application development platform. You are working on enhancements to an existing WPF application. One problem you have been encountering is that users of the current version routinely enter invalid data, and since the controls use data binding, that data either gets put in the database incorrectly, or in some cases generates a database error. You want to incorporate validation with your data bound controls. Which of the following choices is the best way to accomplish this goal?

Options:

A.

Use the default error template and implement it when binding the individual controls to the data source.

B.

Assign validator controls to each control you wish to validate, and incorporate those in the binding of that control to the data source.

C.

Use a custom error template and implement it when binding the individual controls to the data source.

D.

Assign validator controls to each control you wish to validate, and set the validation properties to indicate what constitutes valid data.

Question 55

You work as a Software Developer for ABC Inc. The company uses Visual Studio.NET 2005 as its application development platform. You create a remoting application that provides stock information to customers using .NET Framework. The server component raises an event on the client computer when certain conditions are met. You must ensure that the server raises exactly one event for each client application that is registered for the event. What will you do to accomplish this task?

Options:

A.

Configure the server class as a SingleCall Activated Object (SAO) and check for duplicate client delegate methods before raising the event.

B.

Configure the server class as a Singleton Activated Object (SAO) and check for duplicate client delegate methods before raising the event.

C.

Configure the server class as a Client Activated Object (CAO) and override the CreateObjRef method to check for duplicate client delegate methods before raising the event.

D.

Configure the server class as a Client Activated Object (CAO) and check for duplicate client delegate methods before raising the event.

Question 56

You work as a Software Developer for ABC Inc. The company uses Visual Studio .NET as its application development platform. You create a Windows Forms application by using the .NET Framework. The application executes a background thread. You are required to create the thread to exit, but you must also inform the main thread when the background thread has finished. What will you do to accomplish this?

Options:

A.

Call the Join method of the Thread class.

B.

Call the Sleep method of the Thread class.

C.

Call the Abort method of the Thread class.

D.

Call the Interrupt method of the Thread class.

Question 57

You are working on an ASP.NET application that will handle shopping cart for online users. You wish to generate images of all your company's products dynamically on one of the application's Web pages. You need to modify your configuration settings file for this purpose. Which of the following sections of the configuration file will you use to accomplish the task?

Options:

A.

B.

C.

D.

Question 58

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 an ASP.NET application by using the .NET Framework 3.5. You need to implement a means to monitor Service Level Agreement (SLA) compliance in the application. You are required to identify a method to enable perfect calculation of the time that all requests take to process.

What will you do?

Options:

A.

Create and register a custom HttpModule.

B.

Use the IRequiresSessionState interface.

C.

Use the WebHttpBinding class.

D.

Create and register a custom HttpHandler.

Question 59

Robert works as a Web Developer for MarcLync Inc. He creates a serviced component, named MyComp1. Robert wants to register MyComp1 in a library application, named MyApp1, which is to be used by clients in France and Britain. Which of the following actions will Robert take to accomplish this task?

Each correct answer represents a part of the solution. Choose two.

Options:

A.

Ensure that MyComp1 is signed with a strong name.

B.

Ensure that MyApp1 is signed with a strong name.

C.

Install MyComp1 in the GAC (Global assembly cache).

D.

Copy the files in the GAC (Global assembly cache).

Question 60

Mario works as a Software Developer for BlueWell Inc. He develops an application, named App1, by using Visual Studio .NET. He deploys the application on a client computer. He wants to use the existing assembly named Assembly1. However, Assembly1 needs to be configured in the global assembly cache so that App1 is able to use it. He wants to ensure that the application data transferred to and from the server to the client computer is well secured. Which of the following tools will Mario use to accomplish the task?

Options:

A.

Regasm.exe

B.

Sn.exe

C.

Mscorcfg.msc

D.

Regsvcs.exe

Question 61

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 want to use declarative attributes that configure security for a serviced component of the application. Which of the following attributes will you use in order to support component, interface, or method level role checks?

Options:

A.

SecureMethod

B.

ComponentAccessControl

C.

SecurityRole

D.

ApplicationAccessControl

Question 62

You work as an Enterprise 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 use cross-page posting to redirect users to another page. You want to access the public property values from the source page in the target page. Which of the following actions can you perform to accomplish the task?

Each correct answer represents a complete solution. Choose all that apply.

Options:

A.

Include an @PreviousPageType directive in the target page. Set the VirtualPath attribute to the path of the source page and set the TypeName attribute to the type name of the previous page.

B.

Include an @Master directive in the target page.

C.

Include an @PreviousPageType directive in the target page and set the VirtualPath attribute to the path of the source page.

D.

Include an @Register directive in the target page that references the source page.

Question 63

You work as a Web 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 create a default event handler for an event in the designer. 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.

Options:

A.

In the designer, select the control. In the Properties window, click the lightening bolt button to display the list of events that the control can raise.

B.

In the Code Editor, create a method with a signature that is the same as the signature of the event that you want to handle.

C.

Double-click the entry for the event to create the default event handler. This creates the method with the proper signature, and the Code Editor opens to the new method.

D.

Add the code that you want to execute to the new method when the event is raised.

Question 64

Allen works as a Software Developer for ABC Inc. The company uses Visual Studio.NET 2005 as its application development platform. He develops an application that manipulates files containing confidential information. He wants to make a copy of the existing file, named

ConfidentInfo1 to a new file, named ConfidentInfo2 in the local drive by using an instance method. However, Allen wants to ensure that the existing file does not overwrite the new file.

Which of the following classes' instance method will Allen consider in the application to accomplish the task?

Options:

A.

StringWriter class

B.

FileInfo class

C.

BinaryWriter class

D.

DirectoryInfo class

Question 65

Allen works as a Software Developer for Mansoft Inc. He creates a Console application. He writes the following line of code in the application:

String str="ABC's World";

According to the given line of code, which of the following are legal statements?

Each correct answer represents a part of the solution. Choose all that apply.

Options:

A.

String st1="Hello" + str;

B.

int j=str.Length;

C.

str[2]="y";

D.

str=str+10;

E.

str=5;

Question 66

You work as a Web Application Developer for SunInfo Inc. The company uses Visual Studio 2008 as its application development platform. You create an ASP.NET AJAX application using .NET Framework 3.5. You have enabled debugging in your application to get error information. Now, you want to deploy the release version of the application. How will you set the application to release mode?

Each correct answer represents a part of the solution. Choose all that apply.

Options:

A.

Set the debug attribute of the @Page directive to false.

B.

Set the ScriptMode property of the ScriptManager control to Debug in pages that contain a ScriptManager control.

C.

In the Web.config file, set the compilation element's debug attribute to false.

D.

Set the ScriptMode property of the ScriptManager control to Release in pages that contain a ScriptManager control.

Question 67

You work as a Software Developer for ManSoft Inc. The company uses Visual Studio .NET as its application development platform. You create an application named MyRandomGen. You use the System.Security.Cryptography namespace. You want to create a code that randomly rolls the dice fifty times and displays the results on the screen. Which of the following code segments will you use to accomplish this task?

Options:

A.

for(int x = 0; x <= 50; x++)

Console.WriteLine(RollTheDice(6));

public static int RollTheDice(int sides)

{

byte[] random = new byte[1];

RNGCryptoServiceProvider Gen = new RNGCryptoServiceProvider();

Gen.GetBytes(random);

int ran = Convert.ToInt32(random[0]);

return ran % sides + 1;

}

B.

for(int x = 0; x <= 50; x++)

Console.WriteLine(RollTheDice(6));

public static int RollTheDice(int sides)

{

byte[] random = new byte[1];

RNGCryptoServiceProvider Gen = new RNGCryptoServiceProvider();

Gen.GetRandom(random);

int ran = Convert.ToInt32(random[0]);

return ran % sides + 1;

}

C.

for(int x = 0; x <= 50; x++)

Console.WriteLine(RollTheDice(6));

public static int RollTheDice(int sides)

{

byte[] random = new byte[1];

RNGCryptoServiceProvider Gen = new RNGCryptoServiceProvider();

Gen.GetBytes(Gen);

int ran = Convert.ToInt32(random[0]);

return ran % sides + 1;

}

D.

for(int x = 0; x <= 50; x++)

Console.WriteLine(RollTheDice(6));

public static int RollTheDice(int sides)

{

byte[] random = new byte[1];

RNGCryptoServiceProvider Gen = new RNGCryptoServiceProvider();

Gen.RandomNumber(random);

int ran = Convert.ToInt32(random[0]);

return ran % sides + 1;

}

Question 68

Hannah works as a Programmer in a college of Information Technology. The company uses Visual Studio .NET as its application development platform. The Dean of the college wants to obtain the performance report of each student. Hannah develops an application named StudentPerformanceReport by using Visual C# .NET. This application uses a SQL Server database named Database1 and a stored procedure named PROC1. PROC1 executes a query that returns the internal assessment result of each student. Hannah uses a TextBox control named AssessmentText in the application form named MyForm. She wants to display the total test result of each student in the AssessmentText text box control. StudentPerformanceReport uses a SqlCommand object to run PROC1. Hannah wants to write code to call PROC1. PROC1 contains an output parameter and displays its value as "@AssessmentResult" in text format. Which of the following code segments can Hannah use to accomplish this task?

Each correct answer represents a complete solution. Choose two.

Options:

A.

AssessmentText.Text = (string)comm.Parameters["@AssessmentResult"].Value;

B.

AssessmentText.Text = comm.Parameters["@AssessmentResult"].SourceColumn;

C.

AssessmentText.Text = comm.Parameters["@AssessmentResult"].ToString();

D.

AssessmentText.Text = comm.Parameters["@AssessmentResult"].Value.ToString();

Question 69

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?

Options:

A.

Run the command line tool: regasm.exe myservices.dll.

B.

Copy the serviced component assembly into the C:\Program Files\ComPlus Applications fold er.

C.

Run the command line tool: gacutil.exe /i myservices.dll.

D.

Copy the serviced component assembly into the C:\WINDOWS\system32\Com folder.

Question 70

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. The application contains a data-bound control. The user interface (UI) for modifying data from a LinqDataSource control is typically provided through the data-bound control. You are required to perform automatic data modifications. Which of the following conditions are required to enable automatic data modifications?

Each correct answer represents a part of the solution. Choose all that apply.

Options:

A.

The class that is assigned to the ContextTypeName property must derive from DataContext .

B.

The Where property cannot be assigned a value.

C.

The GroupBy property cannot be assigned a value.

D.

The Select property cannot be assigned a value.

E.

The property that is assigned to the TableName property must derive from Table(TEntity).

Question 71

You work as a Software Developer for ABC Inc. The company uses Visual Studio.NET as its application development platform. You create a Windows service application using the .NET Framework. You are required to synchronize execution of some resources across multiple processes.

What will you do to accomplish this task?

Options:

A.

Use the Mutex class.

B.

Use the Monitor class.

C.

Use the ThreadPool class.

D.

Use the Interlocked class.

Question 72

You work as a Database Administrator for ABC Inc. The company has a SQL Server 2000 computer. One of the databases on the server contains a table named Employees, for storing information about employees in the company. There are two employees, Joe and Rick, to whom you want to give additional responsibilities. You want Joe to be allowed to modify only the E-mail column of the table, and Rick should be allowed to modify only the Salary column of the table. Neither Joe nor Rick should be allowed to have permission on the Employees table.

You want to ensure that the above rule is followed strictly. What will you do to accomplish this?

Options:

A.

Create a user-defined function to modify data.

B.

Create a RULE on both the columns.

C.

Create a stored procedure to modify data

D.

Create a CHECK constraint on both the columns.

Question 73

You work as an Enterprise Application Developer for ABC Inc. The company uses Visual Studio 2008 as its application development platform. You create a web application using .NET Framework 3.5. You have created a form named Form1. You have added Textbox controls for taking Name, Address, and Phone Number of user as input in Form1. You want to ensure that a user enters a value in the Name field. Which of the following validation server controls will you use to accomplish the task?

Options:

A.

RequiredFieldValidator

B.

RangeValidator

C.

CompareValidator

D.

CustomValidator