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

GSSP-.NET Exam Questions Tutorials

Page: 13 / 18
Total 491 questions

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

Question 49

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.

Options:

A.

System.AppDomain.CurrentDomain.SetPrincipalPolicy(PrincipalPolicy.WindowsPrincipal);

PrincipalPermission MyPermission = new PrincipalPermission(null, @"BUILTIN\Users", true);

MyPermission.Demand();

B.

PrincipalPermission MyPermission = new PrincipalPermission(null, @"BUILTIN\Users", true); MyPermission.Demand();

C.

System.AppDomain.CurrentDomain.SetPrincipalPolicy(PrincipalPolicy.WindowsPrincipal);

PrincipalPermission MyPermission = new PrincipalPermission(null, @"Users", true);

MyPermission.Demand();

D.

PrincipalPermission MyPermission = new PrincipalPermission(null, @"Users", true);

MyPermission.Demand();

Question 50

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 StringRW using .NET Framework. You store some characters into an array of Unicode characters. You need to write all or some of these characters into a String object. Which of the following code segments will you choose to accomplish this task?

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

Options:

A.

StringBuilder sb = new StringBuilder("This is my character String Builder");

char[] b = { 'c', 'l', 'a', 's', 's', 'r', 'i', 'g', 'h', 't', 'd', 'o', 'd' };

StringWriter sw = new StringWriter(sb);

Object obj=(Object)b;

sw.Write(obj);

Console.WriteLine(sb);

sw.Close();

B.

StringBuilder sb = new StringBuilder("This is my character String Builder");

char[] b = { 'c', 'l', 'a', 's', 's', 'r', 'i', 'g', 'h', 't', 'd', 'o', 'd' };

StringWriter sw = new StringWriter(sb);

sw.Write(b);

Console.WriteLine(sb);

sw.Close();

C.

StringBuilder sb = new StringBuilder("This is my character String Builder");

char[] b = { 'c', 'l', 'a', 's', 's', 'r', 'i', 'g', 'h', 't', 'd', 'o', 'd' };

string str=new string(b);

StringWriter sw = new StringWriter(sb);

sw.Write(str);

Console.WriteLine(sb);

sw.Close();

D.

StringBuilder sb = new StringBuilder("This is my character String Builder");

char[] b = { 'c', 'l', 'a', 's', 's', 'r', 'i', 'g', 'h', 't', 'd', 'o', 'd' };

StringWriter sw = new StringWriter(sb);

sw.Write(b, 0, 5);

Console.WriteLine(sb);

sw.Close();

Question 51

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?

Options:

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.

Question 52

Sophia works as a Software Developer for BlueWell Inc. She creates a component, named MyComp, using Visual Studio .NET. MyComp includes a method named MyMethod1, which is used to process user requests. MyMethod1 calls a private method, named MyMethod2. Sophia wants to ensure that if an error occurs during the execution, the exceptions encountered by MyMethod2 are caught and passed on to MyMethod1 for exception handling. Which of the following combinations of the exception handler should she use to accomplish the task?

Options:

A.

try, catch, and throw

B.

catch, finally, and throw

C.

try, catch, and finally

D.

try and throw

Page: 13 / 18
Total 491 questions