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

GIAC GSSP-NET-CSHARP - GIAC GIAC Secure Software Programmer - C#.NET

Page: 1 / 15
Total 491 questions

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 names for the application with three characters that are either "hat" or "cat". Which of the following regular expressions will you use to accomplish the task?

A.

[hc]at$

B.

^[hc]at

C.

[hc]at

D.

.at

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 uses Session objects. You are changing the application to run on a Web farm. You want to make sure that the application can access the Session objects from all the servers in the Web farm. You also make sure that when any server in the Web farm restarts or stops responding, the Session objects are not lost. What will you do?

A.

Use InProc Session Management mode to store session data in the ASP.NET worker process

B.

Use StateServer Session Management mode to store session data in a common State Server process on a Web server in the Web farm

C.

Use SQLServer Session Management mode to store session data in an individual database for each Web server in the Web farm

D.

Use SQLServer Session Management mode to store session data in a common Microsoft SQL Server 2005 database

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:

You work as a Software Developer for ABC Inc. The company uses Visual Studio.NET as its application development platform. You need to read the entire contents of a file named Msg.txt into a single string variable using .NET Framework. Which of the following code segments will you use to accomplish the task?

A.

string NewResult = string.Empty;

StreamReader Strreader = new StreamReader("Msg.txt");

While (!Strreader.EndOfStream) {

NewResult += Strreader.ToString();

B.

string NewResult = null;

StreamReader Strreader = new StreamReader("Msg.txt");

NewResult = Strreader.ReadLine();

C.

string NewResult = null;

StreamReader Strreader = new StreamReader("Msg.txt");

NewResult = Strreader.ReadToEnd();

D.

string NewResult = null;

StreamReader Strreader = new StreamReader("Msg.txt");

NewResult = Strreader.Read().ToString();

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.

.

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 using the .NET Framework. You are required to call an unmanaged method from your managed code with the help of platform invoke services. What will you do to accomplish this task?

A.

1. Export a type library for your managed code

B.

1. Import a type library as an assembly

2. Create instances of COM object

C.

1. Register your assembly by using COM

2. Reference your managed code from COM

D.

1. Create a class to hold DLL methods

2. Create prototype methods with managed code

You work as a Windows Application Developer for ABC Inc. The company uses Visual Studio .NET as its application development platform. You create a Windows application using the .NET Framework. You create a Semaphore class instance in the application by using the following code snippet:

Semaphore tSema = new Semaphore(0, 5);

...

tSema.Release(6);

What will the above code segment do?

A.

It will set the maximum count for the semaphore to 6.

B.

It will set the initial count for the semaphore to 5.

C.

It will throw a SemaphoreFullException.

D.

It will throw a ThreadAbortException.

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

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?

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

Sam works as a Software Developer for GenTech Inc. He deploys an ASP.NET application on a server. When an error occurs, users are redirected to a custom error page that is specified in the Web.config file. Users report that a particular page repeatedly generates errors. Sam wants to gather detailed information about the error on this page. He also wants to ensure that users continue to be redirected to the custom error page, if the requested pages generate errors. What will Sam do to accomplish this?

A.

In the Web.config file, set the mode attribute of the customErrors element to RemoteOnly.

Access the page from a browser on the server.

B.

Modify the Web.config file to include the following element:

Access the application from a browser on a client computer.

C.

In the Web.config file, set the mode attribute of the customErrors element to RemoteOnly.

Access the page from a browser on a client computer.

D.

Modify the @ Page directive so that the Trace and the LocalOnly attributes are set to true.

Access the page from a browser on the server.