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

Home > GIAC > GIAC Certification > GSSP-.NET

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

Question # 4

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 # 5

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 # 6

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 that will perform statistics calculations using .NET Framework. You want to ensure that the application is capable of performing multiple calculations concurrently. What will you do to accomplish the task?

A.

Set the Process.GetCurrentProcess().BasePriority property to High.

B.

Set the ProcessorAffinity property of the ProcessThread class object.

C.

For every calculation, call the QueueUserWorkItem method of the ThreadPool class.

D.

Set the IdealProcessor property of the ProcessThread class object.

Full Access
Question # 7

You work as a Software Developer for ABC Inc. The company uses Visual Studio .NET 2005 as its application development platform. You have created a class named Customer to be used in a billing application. The Customer class is shown below.

class Customer

{

public string FirstName { get; set; }

public string LastName { get; set; }

}

Each instance of the Customer class contains information about a customer of your company. You have written a segment of code that populates an ArrayList with a collection of Customer objects as shown below.

ArrayList customers = new ArrayList();

Customer myCustomer = new Customer();

myCustomer.FirstName = "Helen";

myCustomer.LastName = "of Troy";

customers.Add(myCustomer);

myCustomer = new Customer();

myCustomer.FirstName = "Elvis";

myCustomer.LastName = "Presley";

customers.Add(myCustomer);

You need to write code that iterates through the customers ArrayList and displays the name of each customer at the command prompt.

Which code segment should you choose?

A.

foreach (Customer customer in customers) {

Console.WriteLine("{0} {1}",

(Customer)customer.FirstName,

(Customer)customer.LastName);

}

B.

foreach (Customer customer in customers) {

Console.WriteLine("{0} {1}",

customer.FirstName,

customer.LastName);

}

C.

for (int counter = 0; counter <= customers.Count; counter++) {

Console.WriteLine(customers[counter].ToString());

}

D.

for (int counter = 0; counter <= customers.Count; counter++) {

Console.WriteLine(customers[counter]);

}

Full Access
Question # 8

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 # 9

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

A.

Use the dumpbin.exe.

B.

Use a COM/DCOM server.

C.

Use the Makecert.exe.

D.

Use the Dispinterface.

Full Access
Question # 10

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

You want to ensure that the data input by a user falls within a predetermined range. Which of the following validation controls will you use to accomplish the task?

A.

RangeValidator

B.

CompareValidator

C.

RequiredFieldValidator

D.

RegularExpressionValidator

Full Access
Question # 11

You work as a Software Developer for ABC Inc. The company has several branches worldwide. The company uses Visual Studio.NET 2005 as its application development platform. You are creating an application for the branch in China. You are also implementing encoding in the application for Chinese language. Which of the following encoding types will you use to support Chinese language?

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

A.

UTF-16

B.

UTF-8

C.

UTF-32

D.

ASCII

Full Access
Question # 12

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 # 13

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 # 14

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 # 15

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 # 16

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 # 17

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?

A.

Everything

B.

FullTrust

C.

Nothing

D.

Execution

E.

LocalIntranet

F.

Internet

Full Access
Question # 18

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

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

A.

Al.exe

B.

Regsvcs.exe

C.

Regasm.exe

D.

Mscorcfg.msc

Full Access
Question # 19

Daniel works as a Software Developer for GenTech Inc. He develops an ASP.NET application, named

App1, using Visual Studio .NET. He creates an interface in App1, named Employees. The Employees interface contains declaration for a method, named Method1. Daniel creates another interface, named HeadOfDept. HeadOfDept inherits from the Employees interface and contains the declaration for a method, named Method2. He then creates a class named Manager as follows:

public class Manager : HeadOfDept

Which of the following statements about the application are true?

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

A.

The Manager class must implement the Method1 method.

B.

The Manager class implements the HeadOfDept interface.

C.

The Manager class must implement the Method2 method.

D.

The Method1 method can have any access modifier.

Full Access
Question # 20

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?

A.

Regular expressions

B.

Nested If statements

C.

Use the String.Length property

D.

A try/catch block

Full Access
Question # 21

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 # 22

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 health monitoring events to raise application audit events in the following situations:

l When users login

l When users modify their password

l When users perform other security-related actions

You must ensure that the application logs all audit events for all applications on the Web server.

What will you do?

A.

Configure the eventMappings Element in the Web.config file to allow an entry for success a udits.

B.

Configure the eventMappings Element in the Web.config file to allow a single entry for auditing events that is present for all audits.

C.

Configure the eventMappings Element in the Machine.config file to allow an entry for success audits.

D.

Configure the eventMappings Element in the Machine.config file to allow a single entry for auditing events that is present for all audits.

Full Access
Question # 23

You work as a Software Developer for ABC Inc. The company uses Visual Studio .NET 2008 as its application development platform. You create an ASP.NET Web application using .NET Framework 3.5. 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 # 24

You work as a Software Developer for ABC Inc. You use Visual Studio .NET to develop a Windows application named MyWindowApp. You implement the security classes of the .NET Framework. When users interact with the application, the role-based validation should perform frequently. You must ensure that only validated Windows NT or Windows 2000 domain users are permitted to access the application. You add the appropriate Imports statements for the System.Security.Principal namespace and the System.Threading namespace. Which of the following code segments will you use to accomplish this task?

A.

Dim identity As WindowsIdentity = _WindowsIdentity.GetAnonymous()

Dim myprincipal As New WindowsPrincipal(identity)

B.

AppDomain.CurrentDomain.SetThreadPrincipal(_

PrincipalPolicy.WindowsPrincipal)

Dim myprincipal As WindowsPrincipal = _CType(Thread.CurrentPrincipal, WindowsPrincipal)

C.

Dim identity As WindowsIdentity = WindowsIdentity.GetCurrent()

Dim myprincipal As New WindowsPrincipal(identity)

D.

AppDomian.CurrentDomain.SetPrincipalPolicy(_

PrincipalPolicy.WindowsPrincipal)

Dim myprincipal As WindowsPrincipal = _CType(Thread.CurrentPrincipal, WindowsPrincipal)

Full Access
Question # 25

Samantha works as a Software Developer for InfoWorld Inc. She develops a Web page named SalesReport.aspx for the employees of the company. However, she wants to ensure that all the requests for a particular employee are not stored on the server's memory. She also wants to ensure that no data is lost even after each user session has expired. Which of the following actions will Samantha take to accomplish the task?

A.

Use a cookieless session state for storing information.

B.

Use the profile properties feature for storing information.

C.

Use the application state for storing information.

D.

Use the session state with cookie for storing information.

Full Access
Question # 26

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 # 27

George works as a Software Developer for ABC Inc. The company uses Visual Studio .NET 2005 as its application development platform. George creates an application using the .NET Framework. He writes the following code snippet in the application:

public class FirstClass

{

public static int test=500;

}

public class SecondClass : FirstClass

{

public static void Main(String[] args)

{

SecondClass mb=new SecondClass();

mb.MyMethod();

}

public void MyMethod()

{

//Appropriate statement

}

}

George wants to modify the value of the test variable in MyMethod to 1000. Which of the following code segments will he place in MyMethod to accomplish this task?

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

A.

base.test=1000;

B.

test=1000;

C.

FirstClass.test=1000;

D.

test=1000.00;

Full Access
Question # 28

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

John wants to display the text "Enter Enrolment Number" within txtEnrolmentNo. He wants to ensure that if a user tries to submit the page without entering an enrolment number, the word "Error" appears next to txtEnrolmentNo. Which of the following actions will he take to accomplish the task?

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

A.

Add a RequiredFieldValidator control to the page. Set its ControlToValidate property to txtEnrolmentNo, InitialValue property to "Enter Enrolment Number", and ErrorMessage property to "Error".

B.

Add a RequiredFieldValidator control to the page. Set its ControlToValidate property to txtEnrolmentNo, ErrorMessage property to "Enter Enrolment Number", and InitialValue property to "Error".

C.

Set the InitialValue property of txtEnrolmentNo to "Enter Enrolment number".

D.

Set the Text property of txtEnrolmentNo to "Enter Enrolment number".

E.

Add a RegularExpressionValidator control to the page. Set its ControlToValidate property to txtEnrolmentNo, ErrorMessage property to "Enter Enrolment Number", and InitialValue property to "Error".

Full Access
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 company hosts a Web site. The Web site offers an online community and shows personal information of the site members. An e-mail account that is used as the user name is compulsory to register with the online community. Therefore, only registered users of the Web site can view the personal information of other members. You are required to ensure that illegal, automated scripts or bots are not permissible to carry out any of the following tasks:

l Register with the Web site.

l Access the personal information of the members.

What will you do?

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

A.

Bind all personal information of the members within SPAN and DIV controls that will toggle to show/hide.

B.

Implement a CAPTCHA image control during the registration and login process.

C.

Deny new user accounts access to the Web site as long as the user does not respond to the e-mail message.

D.

Implement CDATA during the registration and login process.

E.

Implement a one-way function during login process.

F.

Send confirmation email messages to all new registered users.

Full Access
Question # 30

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 append a specified string to the end of the StringBuilder object.

B.

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

C.

To create dynamic or mutable strings.

D.

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

Full Access
Question # 31

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

A.

B.

C.

D.

Full Access
Question # 32

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?

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.

Full Access
Question # 33

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

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 is used to map HTTP requests to HTTP handlers based on a file name extension. You need to ensure that each HTTP handler processes individual HTTP URLs or groups of URL extensions in the application.

Which of the following built-in HTTP handlers will you use to accomplish this task?

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

A.

Generic Web handler (*.ashx)

B.

Generic handler (*.ashx)

C.

Web service handler (*.asmx)

D.

ASP.NET page handler (*.aspx)

E.

Trace handler (trace.axd)

Full Access
Question # 35

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.

A.

The element.

B.

A managed code.

C.

The element.

D.

An unmanaged code.

Full Access
Question # 36

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?

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.

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 create a Windows service application that will be used by Visual Studio .NET applications. You want to ensure that an access to the Windows service is restricted. Therefore, you decide to use the ServiceInstaller class. You want to specify the security context of the Windows service application. Whic

A.

Password property

B.

UserName property

C.

Context property

D.

Account property

Full Access
Question # 38

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

A.

Call the Join method of the Thread class.

B.

Call the Sleep method of the Thread class.

C.

Call the Abort method of the Thread class.

D.

Call the Interrupt method of the Thread class.

Full Access
Question # 39

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 application using .NET Framework. The Web service provides confidential data of employees to applications that manage access to company facilities. The Web service is accessible by using TCP and is sheltered by using WSE 3.0. The company has implemented fingerprint readers to grant employees access to the facilities. All the captured images of the employees' fingerprints are retained by the Web service application. You must make certain that the existing WSE encryption policy can be applied to the fingerprint image. You are required to provide the solution that must reduce the size of the Web service message.

What will you do to accomplish this task?

A.

Configure the Web service to use base64 encoding to pass the binary fingerprint image.

B.

Configure the Web service to use Message Transmission Optimization Mechanism to pass the binary fingerprint image.

C.

Create a SOAP filter to manage encryption for the message.

D.

Create a SOAP extension to manage encryption for the message.

Full Access
Question # 40

Perry works as a Web Developer for BlueWell Inc. He creates a catalog application named MyCatalog for a server using Visual Studio .NET. MyCatalog contains data that describes the pricing values of design catalogs. He wants to ensure that only authenticated users are authorized to access the data. He also wants the data to be secured at the highest level of authentication. Which of the following authentication levels will Perry use to accomplish this?

A.

Packet Privacy

B.

Packet Integrity

C.

Packet

D.

Call

Full Access
Question # 41

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

A.

Match

B.

Matches

C.

Equals

D.

IsMatch

Full Access
Question # 42

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 # 43

Adam works as a Software Developer for ABC Inc. He creates an ASP.NET application, named MyApp. During beta testing of MyApp, he ensures that both developers and beta testers see the actual text of error messages. Adam performs beta testing of other applications on the same test server. All the other applications display ASP.NET error messages. After completing beta testing, Adam promotes the beta test server to a production server. He wants all the applications to display a single, userfriendly error message. Adam also wants to configure MyApp and the production server to meet these goals. What will he do to accomplish the required task with minimum administrative effort?

A.

In the Web.config file for MyApp, add the following element:

B.

In the Machine.config file, add the following element:

C.

In the MyApp.config file, add the following element:

D.

In the MyApp.config file, add the following element:

E.

In the Web.config file for MyApp, add the following element:

F.

In the Machine.config file, add the following element:

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

A.

x/y

B.

+

C.

?

D.

.

Full Access
Question # 45

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

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

A.

The Trace.WriteLine method

B.

The EventLog.WriteEntry method

C.

The EventLog.EventLogSource property

D.

The EventLog.Source property

Full Access
Question # 46

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?

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 };

Full Access
Question # 47

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.

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

}

Full Access
Question # 48

Mark works as a Software Developer for ABC Inc. He is participating in designing a .NET remoting component for an application that will be hosted on a load-balanced farm. For this, he creates a .NET remote object using Visual Studio .NET 2005. The .NET remote object is used to modify properties of a class. The class contains twenty properties. The .NET remote object is frequently used by client applications. He wants to minimize the network traffic. Which of the following actions will he take to accomplish the task?

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

A.

Use the Marshal-by-value objects.

B.

Use the SerializableAttribute attribute.

C.

Use the MarshalByRefObject class.

D.

Use the IDisposable interface.

Full Access
Question # 49

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

A.

Basic authentication

B.

Integrated Microsoft Windows authentication

C.

Forms-based authentication

D.

Digest authentication

Full Access
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 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 # 51

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 # 52

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

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

Manager");

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

Patrick wants to check whether all demands that succeed for Principal_Perm1 also succeed for Principal_Perm2. Which of the following methods of the PrincipalPermission class will he use to accomplish this?

A.

Intersect

B.

IsSubSetOf

C.

IsUnrestricted

D.

Union

Full Access
Question # 53

You work as a Software Developer for ManSoft Inc. You use Microsoft Visual Studio to create a Web service named MyWebService. You create a SOAP message that is not secure in the Web service. You want to use the SoapFilter class in the Web service to filter the SOAP message. Which of the following code segments will you use to accomplish the task?

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

A.

public class MySoapFilter : SoapFilter

{

string soapmsg="This is the soap message I want to filter";

public MySoapFilter()

{ }

public override SoapFilterResult ProcessMessage(SoapEnvelope envelope)

{

this.Trace(soapmsg);

return SoapFilterResult.Continue;

}

}

B.

public class MySoapFilter : SoapFilter

{

string soapmsg="This is the soap message I want to filter";

public override SoapFilterResult ProcessMessage(SoapEnvelope envelope)

{

this.Trace(soapmsg);

return SoapFilterResult.Continue;

}

}

C.

public class MySoapFilter : SoapFilter

{

string soapmsg="This is the soap message I want to filter";

public override SoapFilterResult ProcessMessage(SoapEnvelope envelope)

{

this.Trace();

return SoapFilterResult.Continue;

}

}

D.

public class MySoapFilter : SoapFilter

{

string soapmsg="This is the soap message I want to filter";

public MySoapFilter()

{ }

public override SoapFilterResult ProcessMessage(SoapEnvelope envelope)

{

this.Trace(soapmsg);

return SoapFilterResult;

}

}

Full Access
Question # 54

You work as a Software Developer for ABC Inc. You have created a console application that uses two threads, named thread1 and thread2. You need to modify the code to prevent the execution of thread1 until thread2 completes its execution. Which of the following steps will you take to accomplish this task?

A.

Use a WaitCallBack delegate to synchronize the threads.

B.

Call the sleep() method of thread1.

C.

Call the SpinWait() method of thread1.

D.

Configure thread1 to run at a lower priority.

E.

Configure thread2 to run at a higher priority.

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

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.

Full Access
Question # 56

You work as a Software Developer for ABC Inc. The company uses Visual Studio .NET as its application development platform. You create a method to hash data with the Secure Hash Algorithm (SHA) using .NET Framework. The hash data is passed to the method as a byte array named msg. You are required to calculate the hash of the msg array by using the SHA1. It is also mandatory to place the result into a byte array named Myhash. Which of the following code segments should you use to accomplish the task?

A.

SHA1 Mysha1 = new SHA1CryptoServiceProvider();

Mysha1.GetHashCode();

byte[] Myhash = Mysha1.Hash;

B.

SHA1 Mysha1 = new SHA1CryptoServiceProvider();

byte[] Myhash = null;

Mysha1.TransformBlock(msg, 0, msg.Length, Myhash, 0);

C.

SHA1 Mysha1 = new SHA1CryptoServiceProvider();

byte[] Myhash = BitConverter.GetBytes(Mysha1.GetHashCode());

D.

SHA1 Mysha1 = new SHA1CryptoServiceProvider();

byte[] Myhash = Mysha1.ComputeHash(msg);

Full Access
Question # 57

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 # 58

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

A.

Set the control's DrawMode property to OwnerDrawText, and then implement a custom DrawNode event handler.

B.

Set the control's DrawMode property to OwnerDrawAll, and then implement a custom DrawNode event handler.

C.

Write a code segment in the DrawNode event handler to give the highlight color.

D.

Override the OnPaint method.

Full Access
Question # 59

Hannah works as a Programmer in a college of Information Technology. The company uses Visual Studio .NET as its application development platform. The Dean of the college wants to obtain the performance report of each student. Hannah develops an application named StudentPerformanceReport by using Visual C# .NET. This application uses a SQL Server database named Database1 and a stored procedure named PROC1. PROC1 executes a query that returns the internal assessment result of each student.

Hannah uses a TextBox control named AssessmentText in the application form named MyForm. She wants to display the total test result of each student in the AssessmentText text box control.

StudentPerformanceReport uses a SqlCommand object to run PROC1. Hannah wants to write code to call PROC1. PROC1 contains an output parameter and displays its value as "@AssessmentResult" in text format. Which of the following code segments can Hannah use to accomplish this task?

Each correct answer represents a complete solution. Choose two.

A.

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

B.

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

C.

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

D.

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

Full Access
Question # 60

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

A.

Installutil.exe

B.

Gacutil.exe

C.

Sn.exe

D.

Al.exe

Full Access
Question # 61

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

A.

Server-activated object

B.

Client-activated object

C.

Singleton object

D.

Single call object

Full Access
Question # 62

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

A.

Stack

B.

Queue

C.

Hard disk

D.

Heap

Full Access
Question # 63

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

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

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

A.

Previously loaded assemblies

B.

The application base or root directory

C.

The Gacutil.exe tool in the Global Assembly Cache

D.

Sub-directories in the application's root directory

E.

The culture attribute of the assembly

F.

The correct version of the assembly

G.

The assembly's name

Full Access
Question # 64

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

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

A.

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

B.

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

C.

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

D.

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

Full Access
Question # 65

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

A.

Full Access
Question # 66

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

A.

VBScript

B.

AJAX

C.

JavaScript

D.

Script

Full Access
Question # 67

Which of the following attributes of the customErrors element is used to specify whether custom errors are enabled, disabled, or shown only to remote clients?

A.

Off

B.

Mode

C.

On

D.

RemoteOnly

Full Access
Question # 68

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

A.

ISerializable

B.

SerializableAttribute

C.

ISerializableAttribute

D.

ISerialize

Full Access
Question # 69

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

A.

Use a COM/DCOM server.

B.

Use the Dispinterface.

C.

Use the Makecert.exe.

D.

Use the dumpbin.exe.

Full Access
Question # 70

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

A.

Write a code segment in the DrawNode event handler to give the highlight color.

B.

Override the OnPaint method.

C.

Set the control's DrawMode property to OwnerDrawText, and then implement a custom DrawNode event handler.

D.

Set the control's DrawMode property to OwnerDrawAll, and then implement a custom DrawNode event handler.

Full Access
Question # 71

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

A.

Set SessionMode to Allowed and IntsanceMode to PerSession.

B.

Set SessionMode to Required and IntsanceMode to Single.

C.

Set SessionMode to Required and IntsanceMode to PerCall.

D.

Set SessionMode to Allowed and IntsanceMode to PerCall.

Full Access
Question # 72

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

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

A.

Use the Highest priority.

B.

Use the BelowNormal priority.

C.

Use the Normal priority.

D.

Use the Middle priority.

E.

Use the Lowest priority.

Full Access