GIAC GIAC Secure Software Programmer - C#.NET v6.0 (GSSP-.NET)

Page:    1 / 33   
Total 491 questions

John works as a Software Developer for Blue Well Inc. He wants to create a class named
Class1 and implements the generic IComparable interface. He writes the following code: public class Class1 : System.IComparable<Class1>
However, John needs to compare one object of Class1 with another object. Which of the following code statement will John include in his application?

  • A. public int CompareTo(object obj){}
  • B. public object CompareTo(int obj){}
  • C. public object CompareTo(Class1 obj){}
  • D. public int CompareTo(Class1 obj){}


Answer : D

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.


Answer : D

You work as a Software Developer for ABC Inc. You develop a multi-threaded application named MyMultThreadApp using Visual Studio .NET. The application logs all warning and informational messages in an event log that keeps track of significant events when the application is running. The event log records information that might be useful for troubleshooting or performance analysis. Which of the following are the considerations that you must keep in mind when logging events with multithreaded components?
Each correct answer represents a complete solution. Choose three.

  • A. An exclusive lock should be obtained on the log to avoid race conditions.
  • B. Each shared component should be thread-safe when interacting with an event log.
  • C. The System.Threading namespace should be used to record the identity of each thread for logging messages.
  • D. The Debug and Trace classes should be used to log events.


Answer : A,B,C

You work as a Software Developer for Mansoft Inc. You create an application and use it to create users as members of the local Users group. Which of the following code snippets imperatively demands that the current user is a member of the local Users group?
Each correct answer represents a complete solution. Choose all that apply.
A.
System.AppDomain.CurrentDomain.SetPrincipalPolicy(PrincipalPolicy.WindowsPrincipal);
PrincipalPermission MyPermission = new PrincipalPermission(null, @"BUILTIN\Users", true);
MyPermission.Demand();
B.
System.AppDomain.CurrentDomain.SetPrincipalPolicy(PrincipalPolicy.WindowsPrincipal);
PrincipalPermission MyPermission = new PrincipalPermission(null, @"Users", true);
MyPermission.Demand();
C. PrincipalPermission MyPermission = new PrincipalPermission(null, @"BUILTIN\Users", true); MyPermission.Demand();
D. PrincipalPermission MyPermission = new PrincipalPermission(null, @"Users", true);
MyPermission.Demand();



Answer : A,B

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.


Answer : D

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.


Answer : A

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. [SecurityPermission(SecurityAction.Demand, Flags=SecurityPermissionFlag.UnmanagedCode)]
  • B. [SecurityPermission(SecurityAction.Deny, Flags = SecurityPermissionFlag.UnmanagedCode)]
  • C. [SecurityPermissionSecurityAction.LinkDemand, Flags=SecurityPermissionFlag.UnmanagedCode)]
  • D. [SecurityPermission(SecurityAction.Assert, Flags = SecurityPermissionFlag.UnmanagedCode)]


Answer : A

You work as a Software Developer for ABC Inc. You develop an application using Visual
Studio .NET 2005. You want to print the contents of a document named MyFile1.doc located on the local computer. Therefore, you use the printing controls in the application.
Which of the following events will you use in the application code to accomplish the task?

  • A. EndPrint
  • B. QueryPageSettings
  • C. PrintPage
  • D. BeginPrint


Answer : C

Tony works as a Software Developer for TechNet Inc. He creates a satellite assembly named
SatAssembly1. He wants to install SatAssembly1 in the global assembly cache. Therefore, he compiles the assembly by using the Al.exe tool and signs SatAssembly1. Which of the following possible tools will Tony use to sign SatAssembly1?
Each correct answer represents a complete solution. Choose two.

  • A. Installer tool
  • B. File Signing tool
  • C. .NET Services Installation tool
  • D. Strong Name tool


Answer : B,C

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


Answer : B,D,E,G

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


Answer : C

John works as a Web Developer for TechCom Inc. He creates an ASP.NET application, named MyApp1, using Visual Studio .NET. Only registered users of the company will be able to use the application. The application contains a page, named NewAccount.aspx that allows new users to register themselves to the registered user list of the company. The
NewAccount page contains several TextBox controls that accept users' personal details such as username, password, confirm password, first name, last name, home address, zip code, phone number, etc. One of the TextBox controls on the page is named txtZipCode in which a user enters a Zip code.
John wants to ensure that when a user submits the NewAccount page, txtZipCode must contain five numeric digits. He wants least development effort. Which of the following validation controls will he use to accomplish the task?
Each correct answer represents a part of the solution. Choose all that apply.

  • A. CompareValidator
  • B. RequiredFieldValidator
  • C. RangeValidator
  • D. RegularExpressionValidator


Answer : B,D

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


Answer : C

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


Answer : B,C

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. Create a SOAP extension to manage encryption for the message.
  • C. Configure the Web service to use Message Transmission Optimization Mechanism to pass the binary fingerprint image.
  • D. Create a SOAP filter to manage encryption for the message.


Answer : C

Page:    1 / 33   
Total 491 questions