Halloween Special 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: save70

GIAC GSSP-NET-CSHARP Dumps

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

Question 1

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 the .NET Framework.

The application uses a MS SQL server database. The application creates and manages online advertising campaigns. You need the Web application to track the effectiveness of the forthcoming campaigns by evaluating advertising results with operation parameters. This necessitates adding a Web form that executes the following tasks:

l It uses a target URL for all online advertising.

l It logs the referrer URLs.

l It offers live reporting of referral data.

You are required to find out the most effective storage mechanism to log the referral data. What will you do?

Options:

A.

Use an application log.

B.

Use a standalone application file.

C.

Use HTTP modules

D.

Use a database.

E.

Use a text file.

Buy Now
Question 2

Which of the following is used, if a reference to an object is required to be made when it is passed from one application to another?

Options:

A.

Marshal By Reference object

B.

Singleton object

C.

SingleCall object

D.

Marshal By Value object

Question 3

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 4

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 needs a thread that accepts an integer parameter. You write the following code segment in the application:

Thread myThread = new Thread(new ParameterizedThreadStart(doWork));

myThread.Start(125);

You are required to declare the signature of the doWork method. Which of the following method signatures will you use?

Options:

A.

public void doWork(int nCount)

B.

public void doWork(Object oCount)

C.

public void doWork()

D.

public void doWork(Delegate oCount)

Question 5

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

2.0. You want to use a remote object whose lifetime is controlled by a server and the remote object is created for each client request. Which of the following objects will you use to accomplish the task?

Options:

A.

Client activated

B.

MarshalByRefObject

C.

Server activated Singleton

D.

Server activated SingleCall

Question 6

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 is used to exchange structured and type information on the Web using Soap. You want to use the BinaryFormatter and SoapFormatter classes to support RPCs and serialization of a graph of objects. Which of the following interfaces will the BinaryFormatter and SoapFormatter classes implement to accomplish the task?

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

Options:

A.

IFormatter

B.

IFormatable

C.

IRemotingFormatter

D.

IComparable

Question 7

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 for the company. You need to validate the phone number passed to a class as a parameter in the application. Which of the following is the most effective way to verify that the format of the data matches a phone number?

Options:

A.

Regular expressions

B.

Nested If statements

C.

Use the String.Length property

D.

A try/catch block

Question 8

Peter works as a Software Developer for PaulTech Inc. He develops an application for office management, using Visual C# .NET. He creates an OleDbConnection object, named Pcon. He wants to create an OleDbCommand object to retrieve employee details. Which of the following statements will Peter use to set the CommandText and Connection properties to accomplish the required task?

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

Options:

A.

OleDbCommand PCommand = new OleDbCommand("sp_GetDetails", PCon);

B.

PCommand.CommandType = "SELECT * FROM Employees";

C.

PCommand.Connection = Pcon;

D.

PCommand.CommandText = "SELECT * FROM Employees";

E.

PCommand.SetConnection (PCon);

F.

OleDbCommand PCommand = new OleDbCommand();

Question 9

Martha works as a Software Developer for HiTech Inc. She develops a Web application named

SalesApp that contains a Web page named MyWebForm1.aspx. The Web page contains validation controls for the Web server controls on the page. Martha wants the custom validation error message to display if the validation fails to call the validation control on the Web page. Which of the following actions will Martha take to accomplish the task?

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

Options:

A.

Call the Validate method of the validation control.

B.

Check the IsValid property of the validation control.

C.

Handle the Page_Init event handler.

D.

Handle the Page_Load event handler.

Question 10

Maria works as a Software Developer for BlueWell Inc. She develops an application named App1 using Visual Studio .NET 2005. App1 contains several pages. Maria wants to use components that provide services and resources. She also wants to release the resources explicitly by the components. Which of the following methods will she use to accomplish this task?

Options:

A.

The Finalize method of the BackgroundWorker class

B.

The Dispose method of the BackgroundWorker class

C.

The Dispose method of the Component class

D.

The Finalize method of the Component class

Question 11

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 12

You work as a Software Developer for ABC Inc. The Company uses .NET Framework 2.0 as its application development platform. You are creating an application that will perform different types of comparison operations. Therefore, you decide to use only those methods that are available in all the classes of .NET Framework 2.0. Which of the following methods will you use to accomplish the task?

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

Options:

A.

Compare

B.

ToString

C.

Copy

D.

Equals

E.

GetType

Question 13

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.

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

C.

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

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

MyPermission.Demand();

D.

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

MyPermission.Demand();

Question 14

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 15

You work as a Software Developer for ABC Inc. The company uses Visual Studio.NET as its application development platform. You create an application using .NET Framework. The application is using an assembly. You want to ensure that the application provides the best performance. Security is not a consideration. Which of the following permission sets will you use to accomplish the task?

Options:

A.

Everything

B.

FullTrust

C.

Nothing

D.

Execution

E.

LocalIntranet

F.

Internet

Question 16

You work as a Software Developer for ABC Inc. The company uses Visual Studio .NET as its application development platform. You create the definition for a Car class by using the following code segment:

public class Car {

[XmlAttribute(AttributeName = "category")]

public string CarType;

public string model;

[XmlIgnore]

public int year;

[XmlElement(ElementName = "mileage")]

public int miles;

public ConditionType condition;

public Car() {

}

public enum ConditionType {

[XmlEnum("Poor")] BelowAverage,

[XmlEnum("Good")] Average,

[XmlEnum("Excellent")] AboveAverage

}}

You create an instance of the Car class. You fill the public fields of the Car class as shown in the table below:

You are required to recognize the XML block that is produced by the Car class after serialization. Which of the following XML blocks represents the output of serializing the Car class?

Options:

A.

xmlns:xsi="http://www.w3.org/2002/XMLSchema-instance "

xmlns:xsd="http://www.w3.org/2002/XMLSchema "

category="sedan">

racer

15000

Excellent

B.

xmlns:xsi="http://www.w3.org/2002/XMLSchema-instance "

xmlns:xsd="http://www.w3.org/2002/XMLSchema "

category="sedan">

racer

15000

Excellent

C.

xmlns:xsi="http://www.w3.org/2002/XMLSchema-instance "

xmlns:xsd="http://www.w3.org/2002/XMLSchema ""

CarType="sedan">

racer

15000

AboveAverage

D.

xmlns:xsi="http://www.w3.org/2002/XMLSchema-instance "

xmlns:xsd="http://www.w3.org/2002/XMLSchema ">

sedan

racer

15000

Excellent

Question 17

You work as a Windows Application Developer for ABC Inc. The company uses Visual Studio .NET as its application development platform. You are developing an application for the customer support using the .NET Framework. The customer support application accepts phone numbers. While running a report, you notice that the phone numbers displayed do not pursue similar format. Furthermore, there are cases of missing digits and missing area codes. You are required to ensure that the phone numbers are entered in the following format:

(###) ###- ####

You need to accomplish this task with the least amount of code. What will you do?

Options:

A.

Use the CustomValidator control.

B.

Replace all TextBox controls that are used for phone number input with MaskedTextBox con trols.

C.

Write code that uses a regular expression.

D.

Use the RegularExpressionValidator control.

Question 18

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 application using .NET Framework 3.5. The application uses a SQL Server 2008 database on the network.

You use ADO.NET Data Services that exposes data as resources that are addressable by URIs. You need to access and change data, specifically the standard HTTP verbs of GET, PUT, POST, and DELETE. What will you do to accomplish this?

Options:

A.

Use Object Relational Mapping.

B.

Use GDI objects.

C.

Use Representational State Transfer.

D.

Use a WCF Service.

Question 19

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 20

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?

Options:

A.

PrintDocument.PrintPage

B.

PrintDocument.EndPrint

C.

PrintDocument.QueryPageSettings

D.

PrintDocument.BeginPrint

Question 21

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 for a Bank using the .NET Framework. You create a method that gets the images of cancelled checks and displays them. You presently have access to a method that reads the images from a SQL server database as a sequence of bytes. You need to transfer the image from the SQL server database to a form with the least amount of temporary buffers and files. Which of the following classes will you use to accomplish this task?

Options:

A.

FileStream

B.

NetworkStream

C.

BufferedStream

D.

MemoryStream

Question 22

Mark works as a Software Developer for BlueWell Inc. He is required to create a class, named Members. Each element of this class has a unique ID stored in a database field, named Member_ID. Which of the following options will he use to represent Member_ID, while designing the Members class?

Options:

A.

Event

B.

Property

C.

Method

D.

Function

Question 23

John works as a Web Developer for ProMetaworks Inc. He creates an ASP.NET application, named MyApp1, by using Visual Studio .NET. MyApp1 contains a page, named Page1. Page1 contains a RadioButtonList control that contains five items. John wants to ensure that users select one of the items from the RadioButtonList control before submitting the page. He wants to accomplish the task with least development effort. Which of the following validation controls will he use to accomplish the task?

Options:

A.

CustomValidator

B.

RangeValidator

C.

ValidationSummary

D.

RequiredFieldValidator

Question 24

You work as a Software Developer for ABC Inc. You create a Web service application named MyWebService using Visual Studio .NET 2005. You use the MyWebService to create a SOAP message. You are not sure whether or not the SOAP message format is correct. Therefore, you decide to use the AsynchronousOperationException class. This class is used to throw an exception when the format of a SOAP message is invalid. 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.

Options:

A.

public class MyException : AsynchronousOperationException

{

//Code here

}

B.

public class AsynchronousOperationException : AsynchronousOperationException

{

//Code here

}

C.

public class AsynchronousOperationException : Exception

{

//Code here

}

D.

public class MyException : Exception

{

//Code here

}

Question 25

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 Singleton Activated Object (SAO) and check for duplicate client delegate methods before raising the event.

B.

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.

C.

Configure the server class as a SingleCall Activated Object (SAO) and 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 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 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 27

Maria works as a Software Developer for MaryLync Inc. She develops an application using Visual C# .NET, for National Stock Broker Inc. The application is used to handle sales and purchase of shares. She wants to ensure that whenever an error occurs in the code, the user is directed to an error page called error1.aspx. She writes a class named StockBroker that contains the code for real stock application. Which of the following attributes of the @ Page directive should she use to accomplish the task?

Each correct answer represents a complete solution. Choose two.

Options:

A.

Inherits

B.

Description

C.

ErrorPage

D.

Culture

Question 28

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?

Options:

A.

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.

B.

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.

C.

Create an ActiveX control that converts the photo to the required format and size.

D.

Create a user control that converts the photo to the required format and size.

Question 29

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 uses the Forms authentication mode. Each folder in the application contains confidential Microsoft Excel files. You are required to make sure that bots are not allowed to access the folders in the application. What will you do?

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

Options:

A.

Add a element to the element in the Web.config file.

B.

Set the authorization mode of the traceElements attribute value in the Web.config file.

C.

Add a element to the element in the Web.config file.

D.

Map the Excel files to the ASP.NET ISAPI filter.

E.

Implement a Completely Automated Public Turing Tests to Tell Computers and Humans Apart (CAPTCHA) image control on each page of the application.

Question 30

You work as a Software Developer for ManSoft Inc. The company uses Visual Studio.NET 2005 as its application development platform. The company wants you to develop an application that implements a dynamic data structure for storing valuable data of different types (String, Integer, etc). You develop the application and implement the generic dynamic data structure that can be increased or decreased as and when required. You want to read the data from the data structure. Which of the following enumerators will you use to accomplish the task?

Options:

A.

LinkedList.Enumerator

B.

Stack.Enumerator

C.

Queue.Enumerator

D.

List.Enumerator

Question 31

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 the development of a class named TestCase and you have used only reference types in the class. The class will be used in an application that will use pointers. Therefore, you are required to convert the reference types to pointers in the class. Which of the following keywords will you use to accomplish the task?

Options:

A.

base

B.

virtual

C.

override

D.

unsafe

Question 32

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?

Options:

A.

Use the dumpbin.exe.

B.

Use a COM/DCOM server.

C.

Use the Makecert.exe.

D.

Use the Dispinterface.

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 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 34

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?

Options:

A.

Gacutil.exe

B.

Sn.exe

C.

Installutil.exe

D.

Al.exe

Question 35

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 .NET Framework 2.0. You are required to use a datatype that will store only the numbers. The numbers should be in positive form and should not be larger than 65,535. 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.

short

C.

System.UInt16

D.

ushort

E.

System.Int16

Question 36

You work as a Software Developer for ABC Inc. The company uses Visual Studio .NET as its application development platform. You are creating an assembly named Assem1 using .NET Framework. Assem1 contains a public method. The global cache contains a second assembly named Assem2. You need to ensure that the public method is only called from Assem2. Which of the following permission classes will you use to accomplish the task?

Options:

A.

PublisherIdentityPermission

B.

DataProtectionPermission

C.

StrongNameIdentityPermission

D.

GacIdentityPermission

Question 37

You work as a Software Developer for ABC Inc. The company uses Visual Studio.NET as its application development platform. You create an application using .NET Framework. The application is used to place an assembly on the intranet. Which of the following classes will you use to test whether or not an assembly was located on the intranet?

Options:

A.

GacMembershipCondition

B.

PublisherMembershipCondition

C.

UrlMembershipCondition

D.

ZoneMembershipCondition

E.

SiteMembershipCondition

Question 38

You work as a Software Developer for ABC Inc. The company uses Visual Studio.NET 2005 as its application development platform. You are in the process of creating an application that will handle unmanaged code using the .NET Framework 2.0. Which of the following services will you use to provide interoperability with the unmanaged code?

Each correct answer represents a complete solution. Choose two.

Options:

A.

Windows service

B.

COM Interop Service

C.

Platform Invocation Service

D.

.NET Service Installer

Question 39

John works as a Web Developer for ProMetaworks Inc. He creates an ASP.NET application, named MyApp1, using Visual Studio .NET. MyApp1 contains a page, named Page1. Page1 contains several TextBox controls that accept users' input. John uses several validation controls on the page to validate input controls. He wants to display all the validation error messages on the page in a message box. However, he does not want the validation summary to be displayed inline on the Web page. What will he do to accomplish the task?

Options:

A.

Add a ValidationSummary control to the page. Set its ShowMessageBox and ShowSummary properties to true.

B.

Add a ValidationSummary control to the page. Set its DisplayMode property to MessageBox .

C.

Add a ValidationSummary control to the page. Set its ShowMessageBox property to true and ShowSummary property to false.

D.

Add a CustomValidator control to the page. Write a custom client-side script function. Set the ClientValidationFunction property of the control to the name of the function.

Question 40

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 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. 91. The application uses ASP.NET AJAX, and you need to deploy it in a Web farm environment. You are required to configure SessionState for the application. Which of the following code segments will you use to accomplish this task?

Options:

A.

B.

C.

D.

Question 42

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 43

You work as a Software Developer for ABC Inc. The company uses Visual Studio .NET 2005 as its application development platform. You have created an application for the company. The application uses string concatenation to gather data from multiple email messages, and format the data before displaying it. You want to ensure that the data displays as quickly as possible. Which of the following actions will you take to accomplish the task?

Options:

A.

Write code that uses the Concat() method of the String object.

B.

Write code that uses the Substring() method of the String object.

C.

Write code that uses the plus-sign (+) operator to concatenate the strings.

D.

Write code that uses the Append() method of the StringBuilder object.

Question 44

Julia works as a Software Developer for Mansoft Inc. She develops an application using Visual Studio .NET. The application uses a method named MyMethod, which is located in an unmanaged DLL. Julia wants MyMethod to require the application to allocate unmanaged memory, fill the data, and pass the memory address to the application. She also wants to ensure that on returning from MyMethod, the application de-allocates the unmanaged memory. What will Julia do to accomplish the task?

Options:

A.

Use the methods of the MemoryStream class.

B.

Use the Marshal class.

C.

Derive a new class from the Stream class, and override the allocation methods.

D.

Use a byte array.

Question 45

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 ExceptionHandling using .NET Framework. You write code and execute it, but it causes an error. Now, you want to find out where the exception has occurred.

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

Options:

A.

Source

B.

Message

C.

Data

D.

StackTrace

Question 46

Dilton works as a Software Developer for GREC Research Center (Central). This research center has its subsidiaries in several different cities. Dilton wants to retrieve a Soil Test Report for the Geological Survey Department. He wants the test report to be available to all the members of the department over the Internet. He creates an XML Web service named SampleReport. SampleReport contains a Web method named SoilTestDetails that requires additional security.

Dilton decides to use generic role-based security to secure the SoilTestDetails method from unauthorized users. Dilton writes code to ensure that once a user is authenticated, a user identity named Generic is created. The Generic user identity has a group membership named GeoSurvey to allow the authenticated users access to the SoilTestDetails Web method. Which of the following code segments should Dilton use to accomplish the task?

Options:

A.

GenericIdentity GenIdentity = new GenericIdentity("Generic", "Custom");

string[] GeoRoles = {"GeoSurvey"};

GenericPrincipal GeoPrincipal = new GenericPrincipal(GenIdentity, GeoRoles);

Thread.CurrentPrincipal = GeoPrincipal;

B.

IIdentity GeoIdentity = new GenericIdentity("Generic", "Custom");

WindowsIdentity WinGeoIdentity = (WindowsIdentity) GeoIdentity;

string[] GeoRoles = {"GeoSurvey"};

GenericPrincipal GenGeoPrincipal = new GenericPrincipal(WinGeoIdentity, GeoRoles );

WindowsIdentity.Impersonate(WinGeoIdentity.Token);

C.

IIdentity GeoIdentity = new GenericIdentity("Generic", "GeoSurvey");

IPrincipal GeoPrincipal = new WindowsPrincipal((WindowsIdentity) GeoIdentity);

Thread.CurrentPrincipal = GeoPrincipal;

D.

System.Security.Principal.IIdentity MyGenericIdentity = new GenericIdentity("Generic",

"Custom");

string[] GeoRoles = {"GeoSurvey"};

GenericPrincipal GenGeoPrincipal = new GenericPrincipal(MyGenericIdentity, GeoRoles);

MyGenericIdentity = WindowsIdentity.GetCurrent();

Question 47

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. You use LINQ expressions to read a list of employees from the following XML file:

Sam Paul

Kelly Smith

Joe Healy

Matt Hardy

Tom Altar

Jeff Hay

Kim Shane

Mike Ray

Allen Ryan

Jackline Beneath

Adam Ford

Mike Tyson

You are required to obtain a list of names of employees who are 23 years or older. Which of the following code segments will you use?

Options:

A.

XDocument employees = XDocument.Load("Employees.xml");

var results = from c in employees Descendants() where ((DateTime)c.Attribute

("birthDate")).AddYears(23) < DateTime.Now

select new { FullName = c.Value };

B.

XDocument employees = XDocument.Load("Employees.xml");

var results = from c in employees Descendants("employee") where ((DateTime)c.Attribute

("birthDate")).AddYears(23) < DateTime.Now

select c Attribute("Name");

C.

XDocument employees = XDocument.Load("Employees.xml");

var results = from c in employees Descendants("employee") where ((DateTime)c.Attribute

("birthDate")).AddYears(23) < DateTime.Now

select c Element("employee");

D.

XDocument employees = XDocument.Load("Employees.xml");

var results = from c in employees Descendants("employee") where ((DateTime)c.Attribute

("birthDate")).AddYears(23) < DateTime.Now

select new { FullName = c.Value };

Question 48

You work as a Software Developer for ABC Inc. You develop a Windows-based application named MyApp. The application contains a form named MyForm1 that displays a submit form for registered users. You want to implement a user interface for the application. Which of the following requirements will you consider for the user interface?

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

Options:

A.

The application saves the user-entered data and checks the integrity of the data.

B.

The application components are allowed to handle logging of user-entered data.

C.

The user-entered data are validated through the validation checks applied in the Windows Forms controls.

D.

Users are allowed to enter data in the required fields on the form.

Question 49

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. The company uses Microsoft Windows authentication. All users are in the TESTPRO1 domain. John wants to ensure that all users except Mark, Roger, and David are allowed to access the application. Which of the following code will he use in the application's Web.config file to accomplish the task?

Options:

A.

B.

C.

D.

Question 50

You work as a Software Developer for ABC Inc. The company uses Visual Studio .NET 2005 as its application development platform. You are presently busy implementing a custom trace that logs errors and warnings in a MS SQL Server database. The implementation should allow different applications to decide whether errors or warnings should be logged at a specified time. You install the assembly that contains the trace listener in the GAC on an application server. You want to enable all Web services on the application server to utilize the trace listener by default. You need to ensure that the implementation does not force Microsoft Windows Forms applications that run on the server to utilize the trace listener. What will you do to accomplish this task?

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

Options:

A.

Add the trace listener to the Web.config file for every Web service.

B.

Add the trace listener to the global Web.config file.

C.

Specify trace switches for every Web service in the Web.config file.

D.

Add the trace listener to the machine.config file.

E.

Specify trace switches in the machine.config file.

Question 51

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 your own HTTP handlers that render custom output to the browser in the application. Other than this, under which of the following operations will you use your HTTP handlers?

Each correct answer represents a complete solution. Choose two.

Options:

A.

Image server

B.

Aggregator

C.

Image mapping

D.

RSS feeds

Question 52

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?

Options:

A.

B.

C.

D.

Question 53

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 application using .NET Framework 3.5. The application uses a SQL Server 2008 database on the network.

You use ADO.NET Data Services that exposes data as resources that are addressable by URIs. You access and change data by using the semantics of representational state transfer (REST), specifically the standard HTTP verbs of GET, PUT, POST, and DELETE. You must ensure that when a service violates any other constraint, the service cannot strictly be referred to as RESTful. What will you do?

Options:

A.

Use the layered system constraint.

B.

Use the code on demand constraint.

C.

Use the client-server constraint.

D.

Use the stateless constraint.

E.

Use the cacheable constraint.

Question 54

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. You need to execute a method named ProcAmount in the background of the application. The method requires that an integer value 101 is passed to it. You are required to pass an integer value 101 to start a background thread. Which of the following code segments should you use?

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

Options:

A.

ParameterizedThreadStart tStart;

tStart = new ParameterizedThreadStart(ProcAmount);

Thread thd = new Thread(tStart);

B.

thd.Start(101);

C.

ThreadStart tStart = new ThreadStart(ProcAmount);

Thread thd = new Thread(tStart, 101);

D.

thd.Start();

Question 55

Mark works as a Software Developer for BlueWell Inc. He is required to create a class, named Members. Each element of this class has a unique ID stored in a database field, named Member_ID. Which of the following options will he use to represent Member_ID, while designing the Members class?

Options:

A.

Event

B.

Method

C.

Function

D.

Property

Question 56

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 any single character except "\n". Which of the following wildcard characters will you use to accomplish the task?

Options:

A.

x/y

B.

+

C.

?

D.

.

Question 57

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.

The element.

B.

A managed code.

C.

The element.

D.

An unmanaged code.

Question 58

ASP.NET version 2.0 health monitoring supports an __________.

Options:

A.

Event driven model

B.

Event provider model

C.

Event log model

D.

Event API model

Question 59

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 deployed on an intranet server of the company. You require that the application meets the following requirements:

l Users can log on to the application by using their Active Directory credentials.

l Each Web page in the application must display user name and password controls for an unauthenticated user.

What will you do to accomplish this?

Options:

A.

Use Forms authentication and use the SqlMembershipProvider class.

B.

Use Forms authentication and use the ActiveDirectoryMembershipProvider class.

C.

Use Windows authentication and enable impersonation.

D.

Use Windows authentication and disable impersonation.

Question 60

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?

Options:

A.

Forms-based authentication

B.

Integrated Microsoft Windows authentication

C.

Basic authentication

D.

Digest authentication

Question 61

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 62

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.

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.

Question 63

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?

Options:

A.

B.

C.

D.

Question 64

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 65

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

Options:

A.

StringAlignment

B.

StingFormat

C.

String

D.

LineAlignment

Question 66

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

Options:

A.

Profile API

B.

Health Monitoring API

C.

Error Handling API

D.

Personalization API

Question 67

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

Options:

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.

Question 68

You work as a Software Developer for ABC Inc. The company uses Visual Studio .NET as its application development platform. You create a method to call a COM component using the .NET Framework. You want to use declarative security to request the runtime to run a complete stack walk. You need to ensure that all callers be obliged to level of trust for COM interop before the callers execute the method. Which of the following attributes will you place on the method to accomplish the task?

Options:

A.

[SecurityPermission(SecurityAction.Demand,

Flags=SecurityPermissionFlag.UnmanagedCode)]

B.

[SecurityPermission(SecurityAction.Deny,

Flags = SecurityPermissionFlag.UnmanagedCode)]

C.

[SecurityPermissionSecurityAction.LinkDemand,

Flags=SecurityPermissionFlag.UnmanagedCode)]

D.

[SecurityPermission(SecurityAction.Assert,

Flags = SecurityPermissionFlag.UnmanagedCode)]

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. 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.

Options:

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.

Question 71

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

Options:

A.

IPrincipal

B.

CodeAccessPermission

C.

PrincipalPermission

D.

SecurityPermission

Question 72

You work as a .NET Trainer for ABC Inc. The Company uses .NET Framework as its application development platform. You are creating an application to demonstrate the use of datatypes. You create an unsigned Short datatype in the application. Which of the following values can be assigned to the unsigned Short datatype?

Each correct answer represents a complete solution. Choose three.

Options:

A.

123

B.

65,535

C.

127,625

D.

32,636

E.

-123

Question 73

Which of the following elements will you use to add a script to the ScriptManager declaratively?

Options:

A.

B.

C.

D.