Weekend Sale - Limited Time 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: mxmas70

Home > GIAC > GIAC Certification > GSSP-NET-CSHARP

GSSP-NET-CSHARP GIAC GIAC Secure Software Programmer - C#.NET Question and Answers

Question # 4

Smith works as a Software Developer for ABC Inc. He creates an application using Visual Studio .NET 2005. The application displays "Welcome to ABC" on the top-left corner of a form. He writes the following code:

StringBuilder strbuild1 = new StringBuilder(20);

strbuild1.Append("'Welcome");

strbuild1.Append(" ");

strbuild1.Append("to");

strbuild1.Append(" ");

strbuild1.Append("ABC'");

string str1 = strbuild1.ToString();

Console.WriteLine(str1);

Console.ReadLine();

What is the main purpose of using StringBuilder object in the application?

A.

To create dynamic or mutable strings.

B.

To concatenate two or more different set of strings or a set of Unicode characters.

C.

To convert a value of the StringBuilder object to the String object.

D.

To append a specified string to the end of the StringBuilder object.

Full Access
Question # 5

You work as a Software Developer for Mansoft Inc. You create an ASP.NET Web application named MyWebApp. You implement a security protocol to transmit secured data between a client and a server. You try to authenticate the client computer. However, you are unable to do so, and the AuthenticationException exception is thrown. Which of the following classes will you use to accomplish this task?

Each correct answer represents a complete solution. Choose two.

A.

NegotiateStream

B.

SslStream

C.

Stream

D.

AuthenticatedStream

Full Access
Question # 6

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 .NET Framework 2.0. The application provides accessibility features. The forms in the application display a background image. You want to remove the image whenever a user selects Use High Contrast in the Accessibility Options in Control Panel. You are required to add an event to handle this accessibility setting change. Which of the following events will you use to accomplish this task?

A.

UserPreferenceChanged

B.

StyleChanged

C.

ChangeUICues

D.

DisplaySettingsChanged

Full Access
Question # 7

You work as a Software Developer for Mansoft Inc. You create an application using Visual Studio .NET 2005. You write code in the application and execute it, but it caused an error. Now, you want to find out the reason that has thrown the exception. Which of the following properties will you use to accomplish this task?

A.

Message

B.

TraceSwitch

C.

Data

D.

Source

E.

StackTrace

Full Access
Question # 8

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. The object of the application will be shared by multiple applications. You want to use simple, modular, extensible, and XML-based protocol to exchange messages between remoting applications. What will you do to accomplish the task?

A.

Use the SOAP protocol.

B.

Use the SoapFormatter class.

C.

Use the BinaryFormatter class.

D.

Use client activated objects.

Full Access
Question # 9

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

A.

private int x;

public void fun(){x=5;}

B.

private int x;

private void fun(){x=5;}

C.

public int x;

public void fun() {x=5;}

D.

protected int x;

protected void fun(){x=5;}

E.

int x;

public void fun(){x=5;}

Full Access
Question # 10

Patrick works as a Software Developer for BlueWell Inc. He develops an ASP.NET application

named App1 using Visual Studio .NET. The application displays employee registration form on the company's Web site. The form contains the following fields:

l First Name

l Last Name

l Date of Birth

l E-mail

The application contains a TextBox control for each field. Patrick wants the application to provide a user-defined error message whenever an employee makes a wrong entry on the form. Patrick uses a CustomValidator validation control in the application. Which of the following properties is mandatory if the CustomValidator control is used to validate a user input data entry?

A.

EnableViewState

B.

IsValid

C.

EnableTheming

D.

ErrorMessage

Full Access
Question # 11

You work as a Web Application Developer for ABC Inc. The company uses Visual Studio .NET as its application development platform. You create a Web application using .NET Framework 2.0. The application is for members only. The behavior of the Web application varies according to the role of the user. The Web application uses the ASP.NET Membership control for creation of user accounts. You are required to find out whether a user is a member of a specific role. What will you do?

A.

Pass the role names to the User.IsInRole method.

B.

Pass the user names and passwords to the Membership.ValidateUser method.

C.

Pass the role names to the Roles.RoleExists method.

D.

Pass the user names to the User.IsUserInRole method.

Full Access
Question # 12

Sandra works as a Software Developer for ABC Inc. She develops an application named MyApp that contains a data-bound control named MyDataControl. She wants to use an Oracle database in order to bind data to MyDataControl. Which of the following GUI-based data sources will Sandra use to accomplish the task?

A.

AccessDataSource

B.

SqlDataSource

C.

ObjectDataSource

D.

XmlDataSource

E.

SitemapDataSource

Full Access
Question # 13

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.

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

Full Access
Question # 14

Peter works as a Software Developer for PatSoluTech Inc. He creates a .NET assembly using Visual Studio .NET. He wants to use this assembly in multiple .NET applications on a local computer. He decides to deploy the assembly into the global assembly cache (GAC). What will he do to accomplish the task?

Each correct answer represents a complete solution. Choose two.

A.

Set the public attribute for the assembly.

B.

Register the assembly within the GAC using Gacutil.exe.

C.

Register the assembly within the GAC using Regasm.exe.

D.

Give a strong name to the assembly.

Full Access
Question # 15

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?

A.

Source

B.

Message

C.

Data

D.

StackTrace

Full Access
Question # 16

You work as a Software Developer for ABC Inc. You develop a .NET application form for

registered users. You want to ensure that the form is able to validate data and provide feedback to a user whenever an invalid data is entered by him. According to you, which of the following user feedback mechanisms will be most appropriate?

A.

ErrorProvider component

B.

Tool tip

C.

Status bar

D.

Color scheme

Full Access
Question # 17

You work as a Software Developer for ABC Inc. You use C# .NET to develop a windows application. The application will implement a role-based authorization scheme that is based on a Microsoft SQL Server database of user names. Users will enter their names in a text box named UserName. You must ensure that users are assigned the supervisor role and the PG role by default. Which of the following code segments will you use to accomplish this task?

A.

GenericIdentity identity =

new GenericIdentity(UserName.Text);

string[] RoleArray = {"Supervisor", "PG"};

WindowsPrincipal principal = new WindowsPrincipal(identity);

B.

WindowsIdentity identity =

new WindowsIdentity.GetAnonymous();

string[] RoleArray = {"Supervisor", "PG"};

WindowsPrincipal principal = new GenericPrincipal(identity, RoleArray);

C.

GenericIdentity identity =

new GenericIdentity(UserName.Text);

string[] RoleArray = {"Supervisor", "PG"};

GenericPrincipal principal = new GenericPrincipal(identity, RoleArray);

D.

WindowsIdentity identity =

new WindowsIdentity.GetCurrent();

string[] RoleArray ={"Supervisor", "PG"};

GenericPrincipal principal = new GenericPrincipal(identity, RoleArray);

Full Access
Question # 18

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?

A.

Event

B.

Method

C.

Function

D.

Property

Full Access
Question # 19

You work as a Web Application Developer for ABC Inc. The company uses Visual Studio .NET as its application development platform. You create a Web application using .NET Framework 2.0. The application code restricts access to some pages based on the users' credentials. However, you are required to configure IIS to supply the user's Windows credentials to the Web application. All these credentials must be encrypted. What will you do?

A.

Disable Anonymous access and enable Basic authentication.

B.

Enable Anonymous access and enable Windows authentication provider.

C.

Enable Anonymous access and enable Basic authentication.

D.

Disable Anonymous access and enable Integrated Windows authentication.

Full Access
Question # 20

You work as a Windows Application Developer for ABC Inc. The company uses Visual Studio .NET 2008 as its application development platform. You have recently finished development of a Windows Forms application using .NET Framework 3.5. You have written complex foreach loops to retrieve data from collections. However, you want to modify the application, so that it uses LINQ queries in place of foreach loops. What will be the advantages of using LINQ queries instead of foreach loops?

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

A.

They provide powerful filtering, ordering, and grouping capabilities with least application co de.

B.

They can be ported to other data sources with slight or no alteration.

C.

They provide lambda expression in the form of an expression tree.

D.

They are more concise and readable, particularly when filtering multiple conditions.

Full Access
Question # 21

You work as a Software Developer for ManSoft Inc. The company uses Visual Studio.NET as its application development platform. You create an application using the .NET Framework. You use ManSoft's intranet to deploy the application to client computers. You use the security configuration of the .NET Framework to configure security for the application at the enterprise policy level. Virus attacks caused the IT manager at ManSoft Inc. to tighten the security at the machine level. Users reported that they could no longer execute the application. Which of the following options will you use to resolve this issue?

A.

Include the LevelFinal attribute in the intranet code group policy at the enterprise level by using the Code Access Security Policy tool (Caspol.exe).

B.

Include the Exclusive attributes in the intranet code group policy at the enterprise level by using the Code Access Security Policy tool (Caspol.exe).

C.

Include the LevelFinal attribute in the intranet code group policy at the enterprise level by using the Permission View tool (Permview.exe).

D.

Include the Exclusive attribute in the intranet code group policy at the enterprise level by using the Permission View tool (Permview.exe).

Full Access
Question # 22

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

A.

Gacutil.exe

B.

Sn.exe

C.

Installutil.exe

D.

Al.exe

Full Access
Question # 23

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.

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

Full Access
Question # 24

You work as a Software Developer for Mansoft Inc. The company uses Visual Studio.NET as its application development platform. You create an ASP.NET Web application using the .NET Framework. You want to authenticate the application and then deploy it on a server running

Microsoft Windows Server 2003 Standard Edition hosting Microsoft Internet Information Services 6.0. Which of the following authentication methods will you use to accomplish the task?

Each correct answer represents a complete solution. Choose two.

A.

Integrated Windows

B.

Extensible Authentication Protocol

C.

Windows NT

D.

Anonymous

E.

Basic

Full Access
Question # 25

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 .NET Framework 2.0. The application allows computer engineers to design circuit boards for different types of hardware. You create a custom control that represents the design surface. You are required to highlight the vacant areas on the design surface where a component can be dropped. Which of the following events will you use to accomplish this task?

A.

DragOver

B.

QueryContinueDrag

C.

DragEnter

D.

DragLeave

Full Access
Question # 26

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.

A.

String st1="Hello" + str;

B.

int j=str.Length;

C.

str[2]="y";

D.

str=str+10;

E.

str=5;

Full Access
Question # 27

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 can be run only by a specific set of user credentials. Therefore, other applications are not permitted to employ these user credentials. The ASP.NET application uses asymmetric encryption to encrypt and decrypt messages to other servers. You are required to shield the private key that is used to encrypt and decrypt messages that are accessed by other users or applications on the same server. What will you do to accomplish the task?

A.

Use the Triple Data Encryption Standard algorithm to encrypt the key.

B.

Use the Secure Sockets Layer protocol.

C.

Use the DataProtectionPermission class.

D.

Use the ProtectedData class.

E.

Store the private key in the App_Data directory.

Full Access
Question # 28

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.

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.

Full Access
Question # 29

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?

A.

StringWriter class

B.

FileInfo class

C.

BinaryWriter class

D.

DirectoryInfo class

Full Access
Question # 30

John works as a Web Developer for CyberNet Inc. He develops an ASP.NET application, named MyApp1, using Visual Studio .NET. The application will be used for online-shopping. He deploys the application on the company's Web server. The application receives millions of hits daily. In order to improve the performance of the application, John decides to use the in-process state management feature of ASP.NET for storing the session state information. Which of the following attributes will John use in the <sessionState> element of the application's Web.config file to accomplish the task?

A.

mode="InProcess"

B.

sessionMode="InProc"

C.

sessionMode="InProcess"

D.

mode="InProc"

Full Access
Question # 31

Allen works as a Software Developer for ManSoft Inc. He develops a Web application using Visual Studio .NET. He adds a Web reference to an XML Web service named MyWebService in the application. MyWebService includes a method named MyMethod, which takes user identification number as a parameter and returns a DataSet object containing user information. The System.ArgumentException is thrown if the user identification number is not positioned between 1 and 500. Allen writes a try/catch block to capture the exceptions thrown by the Web service. Which of the following exceptions will the try/catch block catch if a user calls MyMethod passing 501 as a parameter?

A.

System.ApplicationException

B.

System.ArgumentNullException

C.

System.Web.Service.Protocols.SoapException

D.

System.Web.Service.Protocols.SoapHeaderException

Full Access
Question # 32

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

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

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

A.

Create and register a custom HttpHandler class that releases the RSS feeds.

B.

Create a Web form named Updates that releases the RSS feeds.

C.

Create an ASMX Web service component named Updates.

D.

Add the HttpHandler class to the .rss extension.

E.

Create and register a custom HttpModule class.

Full Access
Question # 33

David works as a Software Developer for GenTech Inc. He develops a Web application named

WebApp, which displays the monthly inventory reports of the company. The company's management wants only employees in the Sales Department to have access to WebApp. They will have to be authenticated with a valid username and password. David wants to implement an authorization strategy in the application, which will require the Windows authentication mode of Web security. Which of the following modules will David use to accomplish the task?

A.

AnonymousIdentificationModule

B.

FormsAuthenticationModule

C.

UrlAuthorizationModule

D.

FileAuthorizationModule

Full Access
Question # 34

You work as a Software Developer for ABC Inc. You create a Web page named MyWebPage that displays detailed information of a registered user. The page contains a TextBox Web server control that requires the RangeValidator validation control to validate whether the user has entered the correct date of birth. A validation error message is displayed if the user has entered the value, which is greater than the date of registration. However, you want to ensure that the validation control on the Web page does not occupy any space, but share the same location for the display of error messages on the Web page. You also want to ensure that the layout of the Web page is changed when the error message is displayed. Which of the following actions will you take to accomplish the task?

A.

Design the Dynamic layout of the Web page.

B.

Implement the ValidationSummary control instead of the RangeValidator control.

C.

Design the Static layout of the Web page.

D.

Design the None layout of the Web page.

Full Access
Question # 35

You work as a Software Developer for ABC Inc. The company uses Visual Studio .NET as its application development platform. You need to write a code segment that transfers the contents of a byte array named ToSend by using a NetworkStream object named NetStr. You want to use a cache of size only 8,192 bytes. Which of the following code segments will you use to accomplish the task?

A.

MemoryStream MStream = new MemoryStream(8192); NetStr.Write(ToSend, 0, (int) MStream.Length);

B.

BufferedStream BStream = new BufferedStream(NetStr); BStream.Write(ToSend, 0, 8192);

C.

BufferedStream BStream = new BufferedStream(NetStr, 8192); BStream.Write(ToSend, 0, ToSend.Length);

D.

MemoryStream MStream = new MemoryStream(8192); MStream.Write(ToSend, 0, (int) NetStr.Length);

Full Access
Question # 36

Peter works as a Software Developer for PentaSoft Inc. He develops an application, named App1, using Visual C# .NET. The application is intended to deal with several file input and output operations. He uses the following try structure in the application code to handle errors that occur during the execution of App1.

try

{

//Statements that might cause a runtime error.

}

catch (System.IO.FileNotFoundException ex)

{

//Statements

}

catch (System.IO.PathTooLongException ex)

{

//Statements

}

catch (System.IO.IOException ex)

{

//Statements

}

catch (Exception ex)

{

//Statements

}

What will happen if an exception of type System.IO.DirectoryNotFoundException occurs in the try block?

A.

The catch block that handles an exception of type IOException will be executed.

B.

The catch block that handles an exception of type Exception will be executed.

C.

The catch block that handles an exception of type FileNotFoundException will be executed.

D.

The catch block that handles an exception of type PathTooLongException will be executed.

Full Access
Question # 37

You work as a Software Developer for ABC Inc. The company uses Visual Studio.NET 2005 as its application development platform. You are deploying a class library using the .NET Framework. Portions of your code need to access system environment variables. You need to force a runtime security exception only when the callers that are higher in the call stack do not have necessary permissions to access the resources. Which of the following methods will you use to accomplish the task?

A.

PermitOnly()

B.

Demand()

C.

Assert()

D.

Deny()

Full Access
Question # 38

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 ASP.NET application using .NET Framework 3.5.

The application contains a Web page that will be accessible through the Internet. The Web page holds a Web form that captures data that will be stored in a SQL Server 2008 database. The form at present uses a POST method. The Web page also holds JavaScript validation routines. The validation routines will be used to ensure that the input to the form meets the business requirements and does not contain any code that is unsafe.

There is currently no server-side validation being performed. You are required to evaluate the application and resolve security flaws in the Web page. What will you do?

A.

Change the method of the form action to GET.

B.

Use Script Controls and Extenders.

C.

Create new server-side validation routines.

D.

Move the validation routines to a content page.

Full Access
Question # 39

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.

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.

Full Access
Question # 40

Mark works as a Software Developer for BlueWell Inc. The company uses Visual Studio .NET as its application development platform. He develops four applications using the .NET Framework.. All the four applications use an assembly named MyAssembly. He deploys the applications on the company's intranet. Later, Mark modifies MyAssembly and wants to ensure that all applications use the latest version of MyAssembly. What will he do to accomplish this?

A.

Modify the application configuration file of client computers.

B.

Modify the reference patch of client computers.

C.

Modify the machine configuration file of client computers.

D.

Modify the publisher policy configuration file containing a reference to client computers.

Full Access
Question # 41

Charles works as a Web Developer for TechNet Inc. He develops an application named AdAgentsApp for advertising agents by using Visual Studio .NET. AdAgentsApp uses several Web services provided by the company. The employees in the IT department use only the existing port numbers 80 (HTTP protocol) and 443 (HTTPS protocol) for firewall security. However, they are forbidden to open any other new ports. These ports have been used to ensure the highest security level of authentication.

Which of the following actions should Charles take to maintain the highest security?

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

A.

Use Windows Basic Authentication with SSL.

B.

Use Windows Digest Authentication.

C.

Use Custom Authentication.

D.

Send the encrypted information in SOAP headers.

E.

Use Windows Authentication with Client Certificates.

Full Access
Question # 42

You work as a Software Developer for ABC Inc. The company uses Visual Studio.NET as its application development platform. You have recently finished development of an application using .NET Framework. The application used two threads named threadOne and threadTwo. You are required to modify the code of the application to prevent the execution of threadOne until threadTwo completes execution. What will you do to accomplish this task?

A.

Use a WaitCallback delegate to synchronize the threads.

B.

Configure threadTwo to run at a higher priority.

C.

Configure threadOne to run at a lower priority.

D.

Call the Sleep method of threadOne.

E.

Call the SpinLock method of threadOne

Full Access
Question # 43

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 are creating a global application that will be used by all the branches of the company. You want to perform the encoding of Unicode characters with error detection capability. Which of the following classes will you use to accomplish the task?

Each correct answer represents a complete solution. Choose three.

A.

UTF8Encoding

B.

UnicodeEncoding

C.

UTF7Encoding

D.

UTF32Encoding

E.

ASCIIEncoding

Full Access
Question # 44

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.

A.

IFormatter

B.

IFormatable

C.

IRemotingFormatter

D.

IComparable

Full Access
Question # 45

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?

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.

Full Access
Question # 46

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?

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.");

}

}

Full Access
Question # 47

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?

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

Full Access
Question # 48

Sandra works as a Software Developer for ABC Inc. She develops a Web site on a client computer. She creates a custom control named CustControl1 on a Web page named

MicrosoftCert1. She wants to retain the custom control property information during several round trips to a server. She wants to ensure that the control property is retained even if the view state of the Web page is disabled at the page level. Which of the following client-based techniques for storing state management information will Sandra use to accomplish the task?

A.

Control state

B.

Cookie

C.

Query string

D.

Hidden field

E.

View state

Full Access
Question # 49

You work as a Software Developer for ABC Inc. The company has several branches worldwide.

The company uses Visual Studio.NET 2005 as its application development platform. You have recently finished the development of an application using .NET Framework 2.0. The application can be used only for cryptography. Therefore, you have implemented the application on a computer. What will you call the computer that implemented cryptography?

A.

Cryptosystem

B.

Cryptanalyst

C.

Cryptographic toolkit

D.

Cryptographer

Full Access
Question # 50

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 add a button control to a form named form1. You want to retrieve more information about the mouse event. You use the MouseClick event in your application. Which of the following parameters will you pass to the event handler of the MouseClick event?

A.

An object parameter representing the sender of the event and an instance of KeyEventArgs

B.

An object parameter representing the sender of the event and an EventArgs parameter

C.

An object parameter representing the sender of the event and an instance of KeyPressEven tArgs

D.

An object parameter representing the sender of the event and an instance of MouseEventA rgs

Full Access
Question # 51

Allen works as a Software Developer for Mansoft Inc. He creates an ASP.NET Web application named MyApplication. He wants to use the Health Monitor to monitor MyApplication to record details about events rather than just the values of specific data counters. Which of the following health monitoring child elements will he use to accomplish the task?

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

A.

Rules

B.

Profiles

C.

bufferModes

D.

customErrors

E.

eventMappings

F.

Providers

Full Access
Question # 52

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?

A.

Use LINQ to XML.

B.

Use LINQ to SQL.

C.

Use the XML Schema Definition Tool.

D.

Use ADO.NET Data Services.

Full Access
Question # 53

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.

A.

WindowsPrincipal

B.

GenericIdentity

C.

WindowsIdentity

D.

GenericPrincipal

Full Access
Question # 54

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.

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"));

}

}

Full Access
Question # 55

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 is a library application that catalogs Classes and books. The application contains a DataContext object named Classes and a related line of business object named Books. The Classes DataContext object is queried by using the following LINQ query: var query = from class in Classes where class.Books.All(b => b.Price <= 50) select class;

You have to find out the result that will be returned from the query. What will be the result of the query?

A.

All books that have a price greater than or equal to 50.

B.

All books that have a price less than or equal to 50.

C.

All Classes that have the price of the related book greater than or equal to 50.

D.

All Classes that have the price of the related book less than or equal to 50.

Full Access
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 a .NET remoting application using .NET Framework 2.0.

The object of the application will be shared by multiple applications. You want to use simple, modular, extensible, and XML-based protocol to exchange messages between remoting applications. What will you do to accomplish the task?

A.

Use the BinaryFormatter class.

B.

Use client activated objects.

C.

Use the SoapFormatter class.

D.

Use the SOAP protocol.

Full Access
Question # 57

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?

A.

StreamReader

B.

FileStream

C.

StreamWriter

D.

MemoryStream

Full Access
Question # 58

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

A.

Rich metadata

B.

Compile-time syntax checking

C.

Static typing and IntelliSense

D.

Imperative code

Full Access
Question # 59

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

A.

Asymmetric encryption

B.

Hashing

C.

Salted Hash

D.

Symmetric encryption

Full Access
Question # 60

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

A.

Integrated Windows authentication

B.

Basic authentication

C.

Certificate-based authentication

D.

Digest authentication

Full Access
Question # 61

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

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

PublicKeyToken=29b5ad26c9de9b95'.

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

regsvcs.exe myservices.dll

You must make sure that the application can call the functionality in the serviced component with no exceptions being thrown. What will you do to accomplish this task?

A.

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

B.

Copy the serviced component assembly into the C:\Program 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.

Full Access
Question # 62

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

A.

PPP

B.

FTP

C.

PPTP

D.

PGP

Full Access
Question # 63

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

You must ensure that the method runs without throwing any exception. What will you do to accomplish this task?

A.

Modify the WebMethod attribute in the Web service so that the EnableSession property is set to

true.

B.

Add the following to the System.Web section of the Web.config file:

C.

Add the following to the System.Web section of the Web.config file:

D.

In the client code for the Web service's proxy object, assign a new instance of the

System.Net.CookieContainer object to the CookieContainer property.

E.

In the client code for the Web service's proxy object, assign a new instance of the

System.Net.CookieContainer object to the EnableSession property.

Full Access
Question # 64

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

SocketPermission permission = new SocketPermission(PermissionState.Unrestricted);

permission.Assert(); A number of the applications that use the class library may not have the necessary permissions to open the network socket connections. Therefore, you are required to withdraw the assertion. Which of the following code segments will you use to accomplish the task?

A.

permission.PermitOnly();

B.

CodeAccessPermission.RevertDeny();

C.

permission.Deny();

D.

CodeAccessPermission.RevertAssert();

E.

permission.Demand();

Full Access
Question # 65

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

A.

ADO.NET DataSet

B.

ObjectDataSource

C.

SqlDataSource

D.

XmlDataSource

Full Access
Question # 66

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?

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.

Full Access
Question # 67

What is the difference between Data Encryption Standard (DES) and Data Encryption Algorithm (DEA)?

A.

DES is the modified Lucifer algorithm and DEA is the original.

B.

DES itself is referred to as DEA.

C.

DES is insecure, whereas DEA is secure.

D.

DES is a standard and DEA is an algorithm.

Full Access
Question # 68

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

What will David do to accomplish the task?

A.

Use a query string as a user preference.

B.

Use a session state variable as a user preference.

C.

Use an application state variable as a user preference.

D.

Use a session cookie as a user preference.

Full Access
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?

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.

Full Access
Question # 70

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.

A.

123

B.

65,535

C.

127,625

D.

32,636

E.

-123

Full Access
Question # 71

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

John wants to ensure that whenever the Web page BookItemList.aspx is posted back to the server, the price list should not be changed on the registered user's computer. He also wants to validate the page sent back to the server. Which of the following actions will John take to accomplish the task?

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

A.

Set the EnableEventValidation attribute to false.

B.

Set the EnableEventValidation attribute to true.

C.

Set the EnableViewState attribute to true.

D.

Set the EnableViewState attribute to false.

Full Access
Question # 72

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?

A.

[SecurityPermissionSecurityAction.LinkDemand,

Flags=SecurityPermissionFlag.UnmanagedCode)]

B.

[SecurityPermission(SecurityAction.Deny,

Flags = SecurityPermissionFlag.UnmanagedCode)]

C.

[SecurityPermission(SecurityAction.Demand,

Flags=SecurityPermissionFlag.UnmanagedCode)]

D.

[SecurityPermission(SecurityAction.Assert,

Flags = SecurityPermissionFlag.UnmanagedCode)]

Full Access
Question # 73

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

A.

Password Authentication

B.

Form Authentication

C.

No Authentication

D.

SQL Server Authentication

Full Access