Black Friday Sale Special - Limited Time 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: sntaclus

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

}

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.

You work as a Software Developer for InfoTech Inc. You develop a Windows application named MyWinApp that displays a registration form for users. You want to ensure that whenever a user enters a wrong data in the required TextBox controls, the data will not be accepted by the application. Which of the following actions will you take so that users should enter only valid data?

A.

Use a message box that will display an error message with an error icon.

B.

Use the ErrorProvider component in the application.

C.

Use the HelpProvider component in the application.

D.

Use a message box that will display an error message..

You work as a Web Application Developer for ABC Inc. The company uses Visual Studio .NET as its application development platform. You are creating a Web application using .NET Framework 2.0. The application will be used in Local Area Network (LAN). The Web application reads comma enclosed text files. The text files exist in a subdirectory under the Web application's root directory. You must ensure that users never directly navigate to these files in a Web browser if they are not members of the Accounting role. You are required to write an ASP.NET HTTP handler that will use the FileAuthorizationModule class. Which of the following forms of authentications will you use?

A.

Forms

B.

Mutual

C.

Microsoft Windows Integrated Security

D.

Anonymous

Ross works as a Software Developer for GenTech Inc. He develops a Windows-based application using Visual Studio .NET. He uses the Write method of the Debug and Trace classes to record information about the execution of the application in Windows 2000 event log. Ross performs integration testing on the application. He wants to ensure that only one entry is made to the event log, each time a call is made to the Write method of either class. Which of the following code will he use to accomplish this?

Each correct answer represents a complete solution. Choose two.

A.

EventLogTraceListener RossTraceListener = new EventLogTraceListener("RossEventLogSource");

Trace.Listeners.Add(RossTraceListener);

B.

EventLogTraceListener RossDebugListener = new EventLogTraceListener("RossEventLogSource");

Debug.Listeners.Add(RossDebugListener);

C.

EventLogTraceListener RossTraceListener = new EventLogTraceListener("RossEventLogSource");

Debug.Listeners.Add(RossTraceListener);

Trace.Listeners.Add(RossTraceListener);

D.

EventLogTraceListener RossDebugListener = new EventLogTraceListener("RossEventLogSource");

EventLogTraceListener RossTraceListener = new EventLogTraceListener("RossEventLogSource");

Debug.Listeners.Add(RossDebugListener);

Trace.Listeners.Add(RossTraceListener);

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 create multiple threads in the application and the

threads will execute the same method. You want to synchronize access to a block of code within the method; thus, no two threads execute the block at the same time. What will you do to accomplish this?

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

A.

Add a SynchronizationAttribute attribute to the method that the multiple threads will call.

B.

Call the Interlocked.Increment method before the block of code that needs to be synchroni zed.

C.

Call the Monitor.Enter method before the block of code that needs to be synchronized.

D.

Call the Interlocked.Decrement method after the block of code that needs to be synchroniz ed.

E.

Add a Semaphore object to the method that the multiple threads will call.

F.

Call the Monitor.Exit method after the block of code that needs to be synchronized.

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

A.

PPP

B.

FTP

C.

PGP

D.

PPTP

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

John works as a Web Developer for ABC Inc. He develops an ASP.NET application, named MyApp1, using Visual Studio .NET. The application will be used in the Sales department to generate monthly reports. John wants to deploy the application on the company's intranet. The company uses Microsoft Windows authentication. John wants to deny access to all the members of the Guest1 role. Which of the following attributes will he use in the <authorization> element of the application's Web.config file to accomplish the task?

A.

B.

C.

D.

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

A.

Role-Based Security

B.

Windows NT Security

C.

Imperative Security

D.

Declarative Security