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

Exactprep GSSP-NET-CSHARP Questions

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

Question 45

You work as a Software Developer for Mansoft Inc. The company uses Visual Studio .NET as its application development platform. You create an application named ExceptionHandling using .NET Framework. You write code and execute it, but it causes an error. Now, you want to find out where the exception has occurred.

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

Options:

A.

Source

B.

Message

C.

Data

D.

StackTrace

Question 46

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

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

Options:

A.

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

string[] GeoRoles = {"GeoSurvey"};

GenericPrincipal GeoPrincipal = new GenericPrincipal(GenIdentity, GeoRoles);

Thread.CurrentPrincipal = GeoPrincipal;

B.

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

WindowsIdentity WinGeoIdentity = (WindowsIdentity) GeoIdentity;

string[] GeoRoles = {"GeoSurvey"};

GenericPrincipal GenGeoPrincipal = new GenericPrincipal(WinGeoIdentity, GeoRoles );

WindowsIdentity.Impersonate(WinGeoIdentity.Token);

C.

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

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

Thread.CurrentPrincipal = GeoPrincipal;

D.

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

"Custom");

string[] GeoRoles = {"GeoSurvey"};

GenericPrincipal GenGeoPrincipal = new GenericPrincipal(MyGenericIdentity, GeoRoles);

MyGenericIdentity = WindowsIdentity.GetCurrent();

Question 47

You work as a Windows Application Developer for ABC Inc. The company uses Visual Studio .NET 2008 as its application development platform. You create a Windows Forms application using .NET Framework 3.5. You use LINQ expressions to read a list of employees from the following XML file:

Sam Paul

Kelly Smith

Joe Healy

Matt Hardy

Tom Altar

Jeff Hay

Kim Shane

Mike Ray

Allen Ryan

Jackline Beneath

Adam Ford

Mike Tyson

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

Options:

A.

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

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

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

select new { FullName = c.Value };

B.

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

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

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

select c Attribute("Name");

C.

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

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

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

select c Element("employee");

D.

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

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

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

select new { FullName = c.Value };

Question 48

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

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

Options:

A.

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

B.

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

C.

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

D.

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