Pass the GIAC GIAC Certification GSSP-NET-CSHARP Questions and answers with CertsForce

Viewing page 6 out of 15 pages
Viewing questions 51-60 out of questions
Questions # 51:

You work as a Software Developer for ManSoft Inc. The company uses Visual Studio.NET 2005 as its application development platform. You have recently created an application that includes the code shown below.

string str1 = "ABC";

string str2 = "u";

str2 += "Certify";

Console.WriteLine(str1 == str2);

Console.WriteLine((Object) str1 == (Object) str2);

Console.WriteLine(str1.Equals(str2));

What will be the output of the above code?

Options:

A.

True

True

True


B.

True

False

True


C.

False

False

False


D.

False

True

False


Questions # 52:

You work as a Software Developer for ABC Inc. You use C# .NET to develop a windows application. The application will implement a role-based authorization scheme that is based on a Microsoft SQL Server database of user names. Users will enter their names in a text box named UserName. You must ensure that users are assigned the supervisor role and the PG role by default. Which of the following code segments will you use to accomplish this task?

Options:

A.

GenericIdentity identity =

new GenericIdentity(UserName.Text);

string[] RoleArray = {"Supervisor", "PG"};

WindowsPrincipal principal = new WindowsPrincipal(identity);


B.

WindowsIdentity identity =

new WindowsIdentity.GetAnonymous();

string[] RoleArray = {"Supervisor", "PG"};

WindowsPrincipal principal = new GenericPrincipal(identity, RoleArray);


C.

GenericIdentity identity =

new GenericIdentity(UserName.Text);

string[] RoleArray = {"Supervisor", "PG"};

GenericPrincipal principal = new GenericPrincipal(identity, RoleArray);


D.

WindowsIdentity identity =

new WindowsIdentity.GetCurrent();

string[] RoleArray ={"Supervisor", "PG"};

GenericPrincipal principal = new GenericPrincipal(identity, RoleArray);


Questions # 53:

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?

Options:

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:


Questions # 54:

You work as a Software Developer for ABC Inc. The company uses Visual Studio.NET 2005 as its application development platform. You create a Windows service application that will be used by Visual Studio .NET applications. You want to ensure that an access to the Windows service is restricted. Therefore, you decide to use the ServiceInstaller class. You want to specify the security context of the Windows service application. Whic

Options:

A.

Password property


B.

UserName property


C.

Context property


D.

Account property


Questions # 55:

You work as an ADO.NET Application Developer for ABC Inc. The company uses Microsoft Visual Studio .NET 2008 as its application development platform. You create an ADO.NET application by using .NET Framework 3.5. You are using the System.Linq.Expressions namespace to represent the code expression as objects in the form of expression trees. You want to initialize the members of a newly created object. What will you do to accomplish the task?

Options:

A.

Use the MemberBinding class


B.

Use the UnaryExpression class


C.

Use the MemberBindingType enumeration


D.

Use the MemberListBinding class


Questions # 56:

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 string datatype in the application to store text based information. You want to match character in a string in such a way that the match must occur at the point where the previous match ended. Which of the following characters will you use to accomplish the task?

Options:

A.

\z


B.

\b


C.

\Z


D.

\G


Questions # 57:

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 is used to map HTTP requests to HTTP handlers based on a file name extension. You need to ensure that each HTTP handler processes individual HTTP URLs or groups of URL extensions in the application. Which of the following built-in HTTP handlers will you use to accomplish this task?

Each correct answer represents a part of the solution. Choose all that apply.

Options:

A.

Web service handler (*.asmx)


B.

Generic handler (*.ashx)


C.

Generic Web handler (*.ashx)


D.

ASP.NET page handler (*.aspx)


E.

Trace handler (trace.axd)


Questions # 58:

Maria works as a Software Developer for ManSoft Inc. She develops an application using Visual Studio .NET 2005. Maria wants to ensure that only employees of the Accounts department can view the application. Therefore, she decides to change the configuration settings in the Web.config file.

What will Maria do to accomplish the task?

Options:

A.

Add the <authorization> element in the Web.config file. Then add the <allow users="Accounts" /> attribute in the element.


B.

Add the <authentication> element in the Web.config file.


C.

Add the <authorization> element in the Machine.config file. Then add the <allow

roles="Accounts" /> attribute in the element.


D.

Add the <authorization> element in the Web.config file.


Questions # 59:

You work as a Software Developer for ABC Inc. You create an ASP.NET Web application named MyWebApplication. You want to provide secure access to company's customers. You want to enable users to access the site from any browser by providing their user name and password. Which of the following authentication methods will you use to accomplish this task?

Options:

A.

Windows NT


B.

Secure Socket Layer


C.

Basic


D.

Single Sign-On


E.

Certificate Server


Questions # 60:

You work as a Software Developer for ABC Inc. The company uses Visual Studio .NET 2005 as its application development platform. You are developing the data access component that all applications in your company intranet will use to access Microsoft SQL Server. You must include code to correctly catch and iterate through any number of errors that could be encountered when connecting to SQL Server. Which code segment should you choose?

Options:

A.

string connectionString =

"server=(local); database=Northwind;"

+ "integrated security=true;";

using (SqlConnection cnn = new SqlConnection(connectionString)){

try {

cnn.Open();

} catch (Exception ex) {

// handle the exception...

} catch (SqlException ex) {

foreach (SqlError error in ex.Errors) {

// handle the exception...

}

} finally {

// clean up

}

}


B.

string connectionString =

"server=(local); database=Northwind;"

+ "integrated security=true;";

using (SqlConnection cnn = new SqlConnection(connectionString))}

try {

cnn.Open();

} catch (SqlException ex) {

switch (ex.Number) {

case 1:

// handle the exception...

break;

default:

// handle the exception...

break;

}

} catch (Exception ex) {

// handle


C.

string connectionString =

"server=(local); database=Northwind;"

+ "integrated security=true;";

using (SqlConnection cnn = new SqlConnection(connectionString)){

try {

cnn.Open();

} catch (SqlException ex) {

switch (ex.Number) {

case 1:

// handle the exception...

break;

default:

// handle the exception...

break;

}

} catch (Exception ex) {

// handle


D.

string connectionString =

"server=(local); database=Northwind;"

+ "integrated security=true;";

using (SqlConnection cnn = new SqlConnection(connectionString)){

try {

cnn.Open();

} catch (SqlException ex) {

foreach (SqlError error in ex.Errors) {

// handle the exception...

}

} catch (Exception ex) {

// handle the exception...

} finally {

// clean up

}

}


Viewing page 6 out of 15 pages
Viewing questions 51-60 out of questions