Easter Sale Special 65% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: exams65

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

GIAC GIAC Secure Software Programmer - C#.NET

Last Update May 18, 2024
Total Questions : 491

We are offering FREE GSSP-.NET GIAC exam questions. All you do is to just go and sign up. Give your details, prepare GSSP-.NET free exam questions and then go for complete pool of GIAC GIAC Secure Software Programmer - C#.NET test questions that will help you more.

GSSP-.NET pdf

GSSP-.NET PDF

$35  $99.99
GSSP-.NET Engine

GSSP-.NET Testing Engine

$42  $119.99
GSSP-.NET PDF + Engine

GSSP-.NET PDF + Testing Engine

$56  $159.99
Questions 1

David works as a Software Developer for McRobert Inc. He develops a Windows-based application, named App1, using Visual C# .NET. The application contains a Form control, named Form1. He wants to write code to initialize class-level variables, named Var1, Var2, and Var3, as soon as Form1 is instantiated. Which of the following code will he use to accomplish this?

Options:

A.  

private void Form1_Initialize(System.Object sender, System.EventArgs e)

{

int Var1 = 20;

int Var2 = 40;

int Var3 = 60;

}

B.  

private void Form1_New(System.Object sender, System.EventArgs e)

{

int Var1 = 20;

int Var2 = 40;

int Var3 = 60;

}

C.  

private void Form1_Load(System.Object sender, System.EventArgs e)

{

int Var1 = 20;

int Var2 = 40;

int Var3 = 60;

}

D.  

private void Form1_Create(System.Object sender, System.EventArgs e)

{

int Var1 = 20;

int Var2 = 40;

int Var3 = 60;

}

Discussion 0
Questions 2

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"};

GenericPrincipal principal = new GenericPrincipal(identity, RoleArray);

B.  

GenericIdentity identity =

new GenericIdentity(UserName.Text);

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

WindowsPrincipal principal = new WindowsPrincipal(identity);

C.  

WindowsIdentity identity =

new WindowsIdentity.GetCurrent();

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

GenericPrincipal principal = new GenericPrincipal(identity, RoleArray);

D.  

WindowsIdentity identity =

new WindowsIdentity.GetAnonymous();

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

WindowsPrincipal principal = new GenericPrincipal(identity, RoleArray);

Discussion 0
Questions 3

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 application using .NET Framework 2.0. The application will be used by all the branches of the company. You are using the CompareInfo class for culture-sensitive string comparisons. You write the following code in the application:

String s1 = "C rtify";

String s2 = "c rtify";

String s3 = "c rtify";

You need to compare the s1 string with the s2 string and ensure that the string comparison must ignore case. Which of the following code segments will you use to accomplish the task?

Options:

A.  

CompareInfo cmp = CultureInfo.InvariantCulture.CompareInfo;

Console.WriteLine(cmp.Compare(s1, s2, CompareOptions.Ordinal));

B.  

CompareInfo cmp = CultureInfo.InvariantCulture.CompareInfo;

Console.WriteLine(cmp.Compare(s1, s2, CompareOptions.None));

C.  

CompareInfo cmp = CultureInfo.InvariantCulture.CompareInfo;

Console.WriteLine(cmp.Compare(s1, s2, CompareOptions.IgnoreCase));

D.  

CompareInfo cmp = CultureInfo.InvariantCulture.CompareInfo;

Console.WriteLine(cmp.Compare(s1, s2, CompareOptions.OrdinalIgnoreCase));

Discussion 0
Questions 4

Smith works as a Software Developer for ABC Inc. He creates an application using Visual Studio .NET 2005. The application displays "Welcome to ABC" on the top-left corner of a form. He writes the following code:

StringBuilder strbuild1 = new StringBuilder(20);

strbuild1.Append("'Welcome");

strbuild1.Append(" ");

strbuild1.Append("to");

strbuild1.Append(" ");

strbuild1.Append("ABC'");

string str1 = strbuild1.ToString();

Console.WriteLine(str1);

Console.ReadLine();

What is the main purpose of using StringBuilder object in the application?

Options:

A.  

To create dynamic or mutable strings.

B.  

To concatenate two or more different set of strings or a set of Unicode characters.

C.  

To convert a value of the StringBuilder object to the String object.

D.  

To append a specified string to the end of the StringBuilder object.

Discussion 0
Questions 5

Allen works as a Software Developer for ManSoft Inc. The company uses Visual Studio.NET as its application development platform. He creates an application. He wants to allow remote users to connect and access the application through a dial-up connection via the Internet. All data will be sent across a public network. For security reasons, the management wants to send data through the Internet in an encrypted form. The company plans to use a Layer 2 Tunneling Protocol (L2TP) connection. Which of the following communication protocols will Allen use to accomplish the task?

Options:

A.  

IP Security (IPSec)

B.  

Secure Electronic Transaction (SET)

C.  

Pretty Good Privacy (PGP)

D.  

Triple Data Encryption Standard (3DES)

Discussion 0
Questions 6

You work as a Software Developer for ABC Inc. You create a Console application to create multiple satellite assemblies. Which of the following statements about satellite assemblies are true?

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

Options:

A.  

They do not contain any executable code.

B.  

They are used to deploy language-specific resources for an application.

C.  

The Assembly Linker tool is used to compile .resources files into satellite assemblies.

D.  

An application can have only one satellite assembly.

Discussion 0
Questions 7

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 application using .NET Framework 2.0. You want to authenticate users before using the application. Therefore, you decide to use the authentication method that uses encryption to authenticate users. What will you do to accomplish the task?

Options:

A.  

Use the FileAuthorizationModule class

B.  

Use the Windows authentication provider

C.  

Use Forms authentication provider

D.  

Use Passport authentication provider

Discussion 0
Questions 8

You work as a Software Developer for ABC Inc. The company uses Visual Studio.NET as its application development platform. You create an application using the .NET Framework. You need to use the regular expressions to provide a concise and flexible means for identifying strings of text of interest, such as particular characters, words, or patterns of characters. Which operation will you use to construct the regular expressions?

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

Options:

A.  

Quantification

B.  

Grouping

C.  

Alternation

D.  

Phishing

Discussion 0
Questions 9

You work as a Software Developer for ABC Inc. The company uses Visual Studio .NET 2005 as its application development platform. You have created an application for the company. The application uses string concatenation to gather data from multiple email messages, and format the data before displaying it. You want to ensure that the data displays as quickly as possible. Which of the following actions will you take to accomplish the task?

Options:

A.  

Write code that uses the Concat() method of the String object.

B.  

Write code that uses the Substring() method of the String object.

C.  

Write code that uses the plus-sign (+) operator to concatenate the strings.

D.  

Write code that uses the Append() method of the StringBuilder object.

Discussion 0
Questions 10

Holmes works as a Programmer for HiTech Institute. He develops an ASP.NET application named LibraryRecord by using Visual Studio .NET. The LibraryRecord application uses a SQL Server database named Database1. Database1 contains two tables: Students and Books. The Students table comprises three columns: StudentID, StudentName, and BookID. The Books table comprises two columns: BooksID and BooksName. Holmes creates a stored procedure that returns the records of all students who borrowed books from the institute. What will Holmes do to retrieve the records of the issued books most efficiently?

Options:

A.  

Use the INNER JOIN keyword in his query.

B.  

Use the INNER JOIN keyword more than once in his query.

C.  

Use the LEFT OUTER JOIN keyword in his query.

D.  

Use the WHERE clause in his query.

Discussion 0
Questions 11

Julia works as a Software Developer for Mansoft Inc. She develops an application using Visual Studio .NET. The application uses a method named MyMethod, which is located in an unmanaged DLL. Julia wants MyMethod to require the application to allocate unmanaged memory, fill the data, and pass the memory address to the application. She also wants to ensure that on returning from MyMethod, the application de-allocates the unmanaged memory. What will Julia do to accomplish the task?

Options:

A.  

Use the methods of the MemoryStream class.

B.  

Use the Marshal class.

C.  

Derive a new class from the Stream class, and override the allocation methods.

D.  

Use a byte array.

Discussion 0
Questions 12

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.

Options:

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.

Discussion 0
Questions 13

Which of the following code snippets is an example of tight encapsulation?

Options:

A.  

private int x;

public void fun(){x=5;}

B.  

private int x;

private void fun(){x=5;}

C.  

public int x;

public void fun() {x=5;}

D.  

protected int x;

protected void fun(){x=5;}

E.  

int x;

public void fun(){x=5;}

Discussion 0
Questions 14

Sam works as a Software Developer for GenTech Inc. He develops an application named App1 using Visual Basic .NET. App1 uses a non-COM DLL named Value1.dll, which contains unmanaged code. Sam writes a method named Method1 in Value1.dll as follows:

Method1 Lib "Value1.dll"(ByVal InputVar As String, ByRef WordsVar As String, ByRef

NumbersVar As Integer) As Integer

Sam wants to use Method1 for parsing a string into an array of string values and an array of integers. Sam wants to enable App1 to call this function. Which of the following statements about the method are true?

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

Options:

A.  

The value of the first parameter cannot be changed by a procedure or a function.

B.  

The second parameter will contain all string values found in the first parameter.

C.  

The third parameter will contain all integer values found in the second parameter.

D.  

The third parameter will contain all string values found in the second parameter.

Discussion 0
Questions 15

You work as a Software Developer for Blue Well Inc. You create a mobile Web application for mobile users. You want to ensure that a cookieless session is implemented on it. Which of the following statements are the main reasons of implementing a cookieless session on a mobile Web application?

Each correct answer represents a part of the solution. Choose two.

Options:

A.  

Tests mobile Web applications

B.  

Stores data in Web server memory

C.  

Ensures better compatibility with mobile devices

D.  

Maintains session state of each user

Discussion 0
Questions 16

Maria works as a Software Developer for BlueWell Inc. She develops an application, named App1, using Visual C# .NET. The application displays employee details from a SQL Server database. Maria wants to use a string array, named MyArray, in the application code to store employee names. Which of the following statements will she use to declare MyArray?

Options:

A.  

Option Base 1 string[] MyArray = new string[9];

B.  

string[] MyArray = new string[9];

C.  

Option Base 0 string[] MyArray = new string[9];

D.  

string[] MyArray = new string[0 to 9];

E.  

string MyArray[9] = new string;

Discussion 0
Questions 17

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 write the following code snippet to call a method from the Win32 API by using PInvoke:

int rst = MessageBox(hWd, Mytext, Mycaption, Mytype);

You are required define a method prototype. Which of the following code segments will you use to accomplish this task?

Options:

A.  

[DllImport("user32")] extern int MessageBoxA(int hWd, String Mytext, String Mycaption, uint Mytype);

B.  

[DllImport("user32")] extern int Win32API_User32_MessageBox(Int hWd, String Mytext, String Mycaption, uint Mytype);

C.  

[DllImport("user32")] extern int MessageBox(int hWd, String Mytext, String Mycaption, uint Mytype);

D.  

[DllImport("C:\\WINDOWS\\system32\\user32.dll")] extern int MessageBox(int hWd, String Mytext, String Mycaption, uint Mytype);

Discussion 0
Questions 18

You work as a Web Application Developer for ABC Inc. The company uses Visual Studio .NET as its application development platform. You create a Web application using .NET Framework 2.0. You add a Web Form that contains a button named bCancel. The button allows users to exit the form. When users click the button, validation should not occur. However, during testing you find that clicking the button does not allow users to exit the form. You need to ensure that users can always exit the page. What will you do?

Options:

A.  

Set the CausesValidation property of the bCancel button to false.

B.  

Set the AccessibleName property of the validation controls on the Web Form to "false".

C.  

Set the ControlToValidate property of the validation controls on the Web Form to the ID of the control.

D.  

Set the Enabled property of the validation controls on the Web Form to false.

Discussion 0
Questions 19

Allen works as a Software Developer for ManSoft Inc. He develops an application using Visual Studio .NET 2005. Only the employees of the company use the application. Allen wants to ensure that when a request on a page is made by a user the application asks for his authentication. Which of the following actions will Allen take to accomplish the task?

Each correct answer represents a part of the solution. Choose two.

Options:

A.  

Specify User.Identity to authenticate the user.

B.  

Set the impersonate attribute of the element to true.

C.  

Specify the username and password attributes.

D.  

Set the impersonate attribute of the element to false.

Discussion 0
Questions 20

You work as a Web Application Developer for SunInfo Inc. The company uses Visual Studio 2008 as its application development platform. You create a Web application using .NET Framework 3.5. You want to redirect users to a default error page if an unhandled error occurs within your site. Which of the following actions will you perform to accomplish the task?

Options:

A.  

Set the mode attribute of the customErrors element to Off and the defaultRedirect attribute to an error page within your site.

B.  

Set the statusCode attribute of the error element to 404 and the redirect attribute to a custom error page.

C.  

Set the redirect attribute of the error element to an error page within your site.

D.  

Set the mode attribute of the customErrors element to On and the defaultRedirect attribute to an error page within your site.

Discussion 0
Questions 21

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?

Options:

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.

Discussion 0
Questions 22

Which of the following is TRUE about a managed thread?

Options:

A.  

It is a foreground thread.

B.  

It is a managed assembly.

C.  

It is either a background thread or a foreground thread.

D.  

It is a background thread.

Discussion 0
Questions 23

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. You need to represent a strongly typed lambda expression as a data structure in the form of an expression tree. Which of the following classes will you use to accomplish the task?

Options:

A.  

MethodCallExpression

B.  

Expression(TDelegate)

C.  

Expression

D.  

LambdaExpression

Discussion 0
Questions 24

John works as a Web Developer for Bitsoft Inc. He creates an ASP.NET application, named MyApp1, by using Visual Studio .Net for a University Web site. Students will use MyApp1 to view their term end result. MyApp1 contains an ASP.NET page named, named Page1. Page1 contains a TextBox control, named txtEnrolmentNo, and two Button controls, named btnSubmit and btnCancel respectively.

John wants that if a user tries to submit the page by clicking the Submit button without entering his enrolment the word "Required" appears next to txtEnrolmentNo. However, when a user clicks the Cancel button he is redirected to a new page, named PageCancel.aspx. To accomplish this he adds a RequiredFieldValidator control to the page and sets its ControlToValidate and ErrorMessage properties to txtEnrolmentNo and "Required" respectively. However, when he executes the application he finds that the validation check is also performed on clicking the Cancel button. What is the most likely cause of the issue?

Options:

A.  

The CauseValidation property of btnSubmit is not set to True.

B.  

The CauseValidation property of btnCancel is not set to True.

C.  

The CauseValidation property of btnSubmit is not set to False.

D.  

The CauseValidation property of btnCancel is not set to False.

Discussion 0
Questions 25

Which of the following is an exception of background threads as compared to foreground threads?

Options:

A.  

A background thread does not continue the managed execution environment running.

B.  

A background thread does not affect the outcome of an unhandled exception.

C.  

A background thread belongs to the managed thread pool.

D.  

A background thread changes to a foreground thread at any time.

Discussion 0
Questions 26

Which of the following APIs is used to collect information about any running state and any errors that occur within an ASP.NET application?

Options:

A.  

Profile API

B.  

Health Monitoring API

C.  

Error Handling API

D.  

Personalization API

Discussion 0
Questions 27

John works as a Web Developer for ABC Inc. He develops an ASP.NET application, named MyApp1, using Visual Studio .NET. The application will be used in the Sales department to generate monthly reports. John wants to deploy the application on the company's intranet. The company uses Microsoft Windows authentication. John wants to deny access to all the members of the Guest1 role. Which of the following attributes will he use in the <authorization> element of the application's Web.config file to accomplish the task?

Options:

A.  

B.  

C.  

D.  

Discussion 0
Questions 28

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 rarely experiences errors that cannot be reproduced on a test environment. You are required to ensure that the application meets the following requirements:

l All unanticipated errors are logged.

l Logging is configured with a least amount of alteration to the application code.

What will you do?

Options:

A.  

Override the base class for all forms in the application to add the Try/Catch blocks to all the major functionalities.

B.  

Enable the element in the Web.config file and set the mode attribute to On .

C.  

Enable the element in the Web.config file and set the mode attribute to

RemoteOnly.

D.  

Add an event handler for the Application.Error event to the Global.asax file of the applicatio n.

Discussion 0
Questions 29

David works as a Software Developer for McRobert Inc. He develops a Web application named App1 using Visual Studio .NET. App1 contains several Web forms that display information about an online shopping process. David wants to provide a Web-based shopping catalog to users. However, he wants to ensure that the information about the shopping catalog is secure and requires no server resources.

What will David do to accomplish the task?

Options:

A.  

Use a query string as a user preference.

B.  

Use a session state variable as a user preference.

C.  

Use an application state variable as a user preference.

D.  

Use a session cookie as a user preference.

Discussion 0
Questions 30

What is the main purpose of a try-catch block?

Options:

A.  

To obtain and use resources that are being caught.

B.  

To signal the occurrence of an exception during the program execution.

C.  

To catch and handle an exception generated by an executable code.

D.  

To ensure that the necessary cleanup of external resources is done immediately.

Discussion 0
Questions 31

Henry works as a Software Developer for SoftTech Inc. He creates a Windows form named

MyForm1. The form contains detailed information about a student. The form uses a ListBox control named ListBox1 that concatenates two strings displayed in two TextBox controls. Henry wants a method to return a value for the control. Which of the following options will he consider while creating a method for the control?

Options:

A.  

A method with a string return type.

B.  

A void method that passes only one parameter.

C.  

A method with an integer return type.

D.  

A void method that passes more than one parameter.

Discussion 0
Questions 32

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. The application contains a data-bound control. The user interface (UI) for modifying data from a LinqDataSource control is typically provided through the data-bound control. You are required to perform automatic data modifications. Which of the following conditions are required to enable automatic data modifications?

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

Options:

A.  

The class that is assigned to the ContextTypeName property must derive from DataContext .

B.  

The GroupBy property cannot be assigned a value.

C.  

The property that is assigned to the TableName property must derive from Table(TEntity).

D.  

The Where property cannot be assigned a value.

E.  

The Select property cannot be assigned a value.

Discussion 0
Questions 33

Mark works as a Software Developer for TechBook Inc. He develops an ASP.NET application, named MyApp1, using Visual Studio .NET. MyApp1 contains an ASP.NET page that is used to register new participants to a quiz contest, which is to be held recently in the city of New York. In order to take part in the quiz contest, an applicant must be between the age of fifteen and twenty-five. Mark adds a TextBox control, named txtDateOfBirth, to the page. He wants to ensure that each prospective participant enters his date of birth in txtDateOfBirth. He also wants to verify that prospective participants meet the age requirement. For this, Mark wants to use a custom client script function. He also wants to minimize the number of trips made to the server. Which of the following actions will Mark perform to accomplish the task?

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

Options:

A.  

Add a RequiredFieldValidator control to the page. Set its ControlToValidate property to txtDateOfBirth.

B.  

Set the ClientValidationFunction property of the CustomValidator control to the name of the script function that performs the client-side validation.

C.  

Set the AutoPostBack property of txtDateOfBirth to True.

D.  

Add a CustomValidator control to the page. Set its ControlToValidate property to txtDateOf Birth.

E.  

Set the ClientValidationFunction property of txtDateOfBirth to the name of the script function that performs the client-side validation.

F.  

Set the AutoPostBack property of txtDateOfBirth to False.

Discussion 0
Questions 34

You work as a Software Developer for ABC Inc. You are defining a component for an application. In some deployments, the component will be deployed on the same computer as the application. In other deployments the component will be deployed on a separate computer. The component has implicit dependencies and needs to access and use server-side resources that cannot cross system boundaries.

You must ensure that your component design supports both deployment scenarios. What will you do to accomplish the task?

Options:

A.  

Create a SingleCall object.

B.  

Create a marshal-by-value object.

C.  

Create a marshal-by-reference object.

D.  

Create a Singleton object.

Discussion 0
Questions 35

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.

Discussion 0
Questions 36

Dennis works as a Software Developer for BlueWell Inc. He develops an application, named App1, using Visual C# .NET. App1 contains a class, named Class1, which is stored in a namespace, named BlueWell.Namespace1. Dennis wants to create another class, named Class2, and use Class1 from Class2. For this, he wants to define an alias, named Alias1, and use it in Class2.

Which of the following statements will Dennis use to define Alias1?

Options:

A.  

BlueWell.Namespace1.Class1 : Alias1;

B.  

BlueWell.Namespace1.Class1, Alias1;

C.  

using Alias1 = BlueWell.Namespace1.Class1;

D.  

Alias1 = BlueWell.Namespace1.Class1;

Discussion 0
Questions 37

You work as a Software Developer for InfoTech Inc. You create a Windows form in a Windows-based application named MyWinApp1. You use graphics in the form. You write the following code in your form:

private void MyMouseEvent1(object sender1, MouseEventArgs event)

{

// Code to handle mouse events

}

You want to implement a property of the MouseEventArgs object. This property will return a Point structure that contains the x-coordinate and y-coordinate of the mouse. Which of the following properties of the MouseEventArgs object will you use to accomplish this?

Options:

A.  

Y

B.  

Location

C.  

Button

D.  

X

E.  

Delta

F.  

Clicks

Discussion 0
Questions 38

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 MyApplication. MyApplication uses the System.IO namespace. You want to ensure that you are able to use a class that specifies read and write operations either in synchronous or asynchronous manner. Which of the following classes will you use to accomplish the task?

Options:

A.  

StreamReader

B.  

FileStream

C.  

StreamWriter

D.  

MemoryStream

Discussion 0
Questions 39

Mark works as a Web Developer for ABC Inc. He develops an ASP.NET application, named MyApp1, using Visual Studio .NET. MyApp1 allows users to view and purchase company products.

It includes several pages. The start-up page of the application is Page1.aspx. He configures the application's Web.config file to use form-based authentication.

Mark wants users to log on to Page1.aspx by providing their user names and passwords. To accomplish this, he creates an ASP.NET page named UsersLogIn.aspx that allows each user to specify a user name and password. He then writes the following syntax in the Web.config filE.

loginUrl="/UsersLogIn.aspx"

protection="All"

timeout="60"

slidingExpiration="true">

What will be the result?

Each correct answer represents a part of the solution. Choose two.

Options:

A.  

The session will expire after 60 seconds.

B.  

The session will expire after 60 minutes.

C.  

The session will expire after 60 hours.

D.  

The session lifetime will be reset periodically.

E.  

The session will never expire.

F.  

Once the session lifetime is set, it will not change.

Discussion 0
Questions 40

Sam works as a Software Developer for BlueWell Inc. He creates a .NET Remoting object named MyObj using Visual Studio .NET. He wants to configure MyObj to send and receive confidential information from an XML file stored in an encrypted hard drive. What will he do to accomplish the task?

Each correct answer represents a part of the solution. Choose two.

Options:

A.  

Implement a declarative security check.

B.  

Implement an imperative security check.

C.  

Use the SecurityAction.Demand value for the SecurityAction flag.

D.  

Use the SecurityAction.RequestMinimum value for the SecurityAction flag.

Discussion 0
Questions 41

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. You need to specify an expression that applies a delegate or lambda expression to a list of argument expressions. Which of the following classes will you use to accomplish the task?

Options:

A.  

ListInitExpression

B.  

InvocationExpression

C.  

MemberAssignment

D.  

NewArrayExpression

Discussion 0
Questions 42

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 want to use declarative attributes that configure security for a serviced component of the application. Which of the following attributes will you use in order to support component, interface, or method level role checks?

Options:

A.  

SecureMethod

B.  

ComponentAccessControl

C.  

SecurityRole

D.  

ApplicationAccessControl

Discussion 0
Questions 43

You work as a Software Developer for ABC Inc. You have created a console application that uses two threads, named thread1 and thread2. You need to modify the code to prevent the execution of thread1 until thread2 completes its execution. Which of the following steps will you take to accomplish this task?

Options:

A.  

Use a WaitCallBack delegate to synchronize the threads.

B.  

Call the sleep() method of thread1.

C.  

Call the SpinWait() method of thread1.

D.  

Configure thread1 to run at a lower priority.

E.  

Configure thread2 to run at a higher priority.

Discussion 0
Questions 44

Julia works as a Software Developer for Mansoft Inc. She develops an application using Visual Studio .NET. The application uses a method named MyMethod, which is located in an unmanaged DLL. Julia wants MyMethod to require the application to allocate unmanaged memory, fill the data, and pass the memory address to the application. She also wants to ensure that on returning from MyMethod, the application de-allocates the unmanaged memory. What will Julia do to accomplish the task?

Options:

A.  

Use the methods of the MemoryStream class.

B.  

Derive a new class from the Stream class, and override the allocation methods.

C.  

Use the Marshal class.

D.  

Use a byte array.

Discussion 0
Questions 45

John works as a Web developer for HiTech Inc. He develops an application named MyApp by using Visual C# .NET. John uses a SQL Server database. He writes the following code:

OleDbCommand cmd = new OleDbCommand();

cmd.CommandText = "UPDATE Employees SET Rank = 'Senior' WHERE Basic > 10000"; cmd.ExecuteNonQuery();

Now he wants to improve the performance of the program code. Which of the following actions will he perform to accomplish the task?

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

Options:

A.  

Use a Cache object to execute the program code.

B.  

Use a SqlCommand object instead of an OleDbCommand object.

C.  

Use the Prepare method on the OleDbCommand object before executing the program code.

D.  

Use an OleDbDataReader object to execute the program code.

E.  

Use database indexing.

F.  

Use a stored procedure instead of the CommandText property.

Discussion 0
Questions 46

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. The application contains many controls. You add an ErrorProvider component named errorPro and a DateTimePicker control named datePick to the application. You are required to configure the application to display an error notification icon next to datePick when a user enters a date that is greater than today's date. What will you do to accomplish this task?

Each correct answer represents a part of the solution. Choose two.

Options:

A.  

Create an event handler named verifyDate for the Validating event of datePick.

B.  

Create an event handler named verifyDate for the Validated event of datePick.

C.  

In the verifyDate event handler, call errorPro.SetError(datePick, "Date is greater then today's date") if the value of datePick value is greater than today's date.

D.  

In the verifyDate event handler, call errorPro.SetError(datePick, "") if the datePick.Value is greater than today's date.

Discussion 0
Questions 47

You work as a Software Developer for ABC Inc. The company uses Visual Studio.NET 2005 as its application development platform. You are in the process of creating an application that will handle unmanaged code using the .NET Framework 2.0. Which of the following services will you use to provide interoperability with the unmanaged code?

Each correct answer represents a complete solution. Choose two.

Options:

A.  

Windows service

B.  

COM Interop Service

C.  

Platform Invocation Service

D.  

.NET Service Installer

Discussion 0
Questions 48

Mark works as a Web Developer for TechCom Inc. He creates an ASP.NET application named

Application1 by using Visual Studio .NET. Only registered users of the company will be able to use the application. The application contains a page named UserAcc.aspx that allows new users to register themselves to the registered users' list of the company. The UserAcc page contains several text box controls that accept users' personal details such as user name, password, home address, zip code, phone number, etc. One of the text box controls on the page is named ZipProperty in which a user enters a zip code.

Mark wants to ensure that when a user submits the UserAcc page, ZipProperty must contain five numeric digits. Which of the following validation controls will he use to accomplish the task?

Each correct answer represents a complete solution. Choose two.

Options:

A.  

RequiredFieldValidator

B.  

RangeValidator

C.  

CompareValidator

D.  

RegularExpressionValidator

E.  

RequiredValidator

Discussion 0
Questions 49

You work as a Web Application Developer for SunInfo Inc. The company uses Visual Studio 2008 as its application development platform. You create a Windows Forms application using .NET Framework 3.5. You want to create a default event handler for an event in the designer. Which of the following steps will you take to accomplish the task?

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

Options:

A.  

In the designer, select the control. In the Properties window, click the lightening bolt button to display the list of events that the control can raise.

B.  

In the Code Editor, create a method with a signature that is the same as the signature of the event that you want to handle.

C.  

Double-click the entry for the event to create the default event handler. This creates the method with the proper signature, and the Code Editor opens to the new method.

D.  

Add the code that you want to execute to the new method when the event is raised.

Discussion 0
Questions 50

You work as a Software Developer for ABC Inc. You create a Web service application named MyWebService using Visual Studio .NET 2005. You use the MyWebService to create a SOAP message. You are not sure whether or not the SOAP message format is correct. Therefore, you decide to use the AsynchronousOperationException class. This class is used to throw an exception when the format of a SOAP message is invalid. Which of the following code segments will you use to accomplish the task?

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

Options:

A.  

public class MyException : AsynchronousOperationException

{

//Code here

}

B.  

public class AsynchronousOperationException : AsynchronousOperationException

{

//Code here

}

C.  

public class AsynchronousOperationException : Exception

{

//Code here

}

D.  

public class MyException : Exception

{

//Code here

}

Discussion 0
Questions 51

Maria works as a Software Developer for MaryLync Inc. She develops an application using Visual C# .NET, for National Stock Broker Inc. The application is used to handle sales and purchase of shares. She wants to ensure that whenever an error occurs in the code, the user is directed to an error page called error1.aspx. She writes a class named StockBroker that contains the code for real stock application. Which of the following attributes of the @ Page directive should she use to accomplish the task?

Each correct answer represents a complete solution. Choose two.

Options:

A.  

Inherits

B.  

Description

C.  

ErrorPage

D.  

Culture

Discussion 0
Questions 52

Maria works as a Software Developer for ABC Inc. The company uses Visual Studio .NET 2005 as its application development platform. She creates a Web service and uses a Session object in it. She declares a variable in the Session object. What will be the scope of the variable?

Options:

A.  

The variable will be available as long as a user interacts with it.

B.  

The variable will be available forever.

C.  

The variable will be available even after the session becomes inactive.

D.  

The variable will be available as long as the session is active.

Discussion 0
Questions 53

You work as a Software Developer for ABC Inc. The company uses Visual Studio .NET 2008 as its application development platform. You are creating an ASP.NET Web application using .NET Framework 3.5. The application will be accessed by users from remote locations over the Internet. You need to use ASP.NET role management. You must ensure that any authorization information cached on remote client computers is as secure as possible. What will you do?

Options:

A.  

Use the RsaProtectedConfigurationProvider class.

B.  

Use the DpapiProtectedConfigurationProvider class.

C.  

Set the cookieProtection attribute to Validation in the roleManager element of the Web.conf ig file.

D.  

Set the cookieProtection attribute to Encryption in the roleManager element of the Web.con fig file.

Discussion 0
Questions 54

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 that reads data from and writes data to a file using the .NET Framework 2.0. You want to restrict users to read characters from a byte stream and write characters to a stream. Which of the following classes will you use to accomplish the task?

Each correct answer represents a part of the solution. Choose two.

Options:

A.  

StringReader

B.  

StringWriter

C.  

StreamReader

D.  

StreamWriter

Discussion 0
Questions 55

You work as an Enterprise Application Developer for SunInfo Inc. The company uses Visual Studio 2008 as its application development platform. You create a Windows Forms application using .NET Framework 3.5. You want to notify the users when a print job has finished. Which of the following events will you use to accomplish the task?

Options:

A.  

PrintDocument.PrintPage

B.  

PrintDocument.EndPrint

C.  

PrintDocument.QueryPageSettings

D.  

PrintDocument.BeginPrint

Discussion 0
Questions 56

Allen works as a Software Developer for ManSoft Inc. He uses Microsoft Visual Studio 2005 to create a Web service named MyWebService. He wants to create a policy file with the help of WSE 3.0, which makes creating policy assertions files fairly straightforward. A policy assertion is a combination of the capabilities and requirements of the Web service. Allen initially writes the following steps to create and implement a policy file:

l He creates a stud to hold the policy elements. This task is accomplished by creating a config file known as a policy file or a policy cache file.

l He creates a set of policy assertions. There exists a set of assertions that can be used.

l He references the policy file from the application configuration file.

After completing these steps, the structure of the policy file is created. Now, he wants to use the structure of the policy file to inject input filters, output filters, or both, into the processing pipeline.

Which of the following policy file structures will Allen use to accomplish the task?

Options:

A.  

B.  

C.  

D.  

Discussion 0
Questions 57

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 application using .NET Framework 3.5. The application captures account information. The account number has the following specifications:

l It holds literal and input characters of the alphanumeric type.

l It has a predefined format.

You must ensure that the account number is in the correct format. You must also ensure that only input characters are accepted from users. What will you do?

Options:

A.  

Use a RichTextBox control and create a regular expression to validate the format.

B.  

Use a TextBox control and bind it to a string that has the required format.

C.  

Use a MaskedTextBox control and create a mask to validate the format.

D.  

Use a TextBox control and create a regular expression to validate the format.

Discussion 0
Questions 58

You work as a Software Developer for ABC Inc. The company uses Visual Studio .NET 2008 as its application development platform. You have recently finished the development of an ASP.NET Web application using .NET Framework 3.5. The application must be deployed by using the http://www.ABC.com/ URL. The application has several Web forms.

You need to implement Really Simple Syndication (RSS) feeds functionality. The RSS feeds will be used by the http://www.ABC.com/Updates.rss URL. You must ensure that the application displays the RSS-formatted information when accessing the given URL. What will you do to accomplish this?

Each correct answer represents a part of the solution. Choose two.

Options:

A.  

Create and register a custom HttpHandler class that releases the RSS feeds.

B.  

Create a Web form named Updates that releases the RSS feeds.

C.  

Create an ASMX Web service component named Updates.

D.  

Add the HttpHandler class to the .rss extension.

E.  

Create and register a custom HttpModule class.

Discussion 0
Questions 59

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 need to execute a method named ProcAmount in the background of the application. The method requires that an integer value 101 is passed to it. You are required to pass an integer value 101 to start a background thread. Which of the following code segments should you use?

Each correct answer represents a part of the solution. Choose two.

Options:

A.  

thd.Start(101);

B.  

ParameterizedThreadStart tStart; tStart = new ParameterizedThreadStart(ProcAmount);

Thread thd = new Thread(tStart);

C.  

thd.Start();

D.  

ThreadStart tStart = new ThreadStart(ProcAmount);

Thread thd = new Thread(tStart, 101);

Discussion 0
Questions 60

Sam works as a Software Developer for SamTech Inc. He develops a Windows-based application, named App1, using Visual Studio .NET. He wants to set a security policy for the application. To accomplish the task he uses the PolicyLevel class. He wants to set the current policy level to the default state. Which of the following methods will he use to accomplish the task?

Options:

A.  

Resolve

B.  

ChangedNamePermissionSet

C.  

Reset

D.  

Recover

Discussion 0
Questions 61

Samantha works as a Software Developer for InfoWorld Inc. She develops a Web page named SalesReport.aspx for the employees of the company. However, she wants to ensure that all the requests for a particular employee are not stored on the server's memory. She also wants to ensure that no data is lost even after each user session has expired. Which of the following actions will Samantha take to accomplish the task?

Options:

A.  

Use a cookieless session state for storing information.

B.  

Use the profile properties feature for storing information.

C.  

Use the application state for storing information.

D.  

Use the session state with cookie for storing information.

Discussion 0
Questions 62

You work as a Software Developer for ABC Inc. The Company uses .NET Framework 2.0 as its application development platform. You are creating an application that will perform different types of comparison operations. Therefore, you decide to use only those methods that are available in all the classes of .NET Framework 2.0. Which of the following methods will you use to accomplish the task?

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

Options:

A.  

Compare

B.  

ToString

C.  

Copy

D.  

Equals

E.  

GetType

Discussion 0
Questions 63

You work as an Enterprise Application Developer for ABC Inc. The company uses Visual Studio .NET as its application development platform. You create a Windows client application that communicates with a business layer component using the .NET Framework. The business layer component includes a class named MyUtility as follows:

public class MyUtility

{

public MyUtility() { }

public void ChangeData() { }

}

The application must fulfill the following criteriA.

l Create instances of the MyUtility class only within the business component.

l The application should invoke the functions within the MyUtility class.

You evaluate the code of the MyUtility class and decide it requires modification. Which of the following modifications for the code will you recommend?

Options:

A.  

Change the scope of the MyUtility class to private.

B.  

Change the scope of the constructor to private.

C.  

Change the scope of the constructor to internal.

D.  

Change the scope of the MyUtility class to internal.

Discussion 0
Questions 64

You work as a Software Developer for ABC Inc. The company uses Visual Studio.NET as its application development platform. You create an application using .NET Framework. The application is using an assembly. You want to ensure that the application provides the best performance. Security is not a consideration. Which of the following permission sets will you use to accomplish the task?

Options:

A.  

Everything

B.  

FullTrust

C.  

Nothing

D.  

Execution

E.  

LocalIntranet

F.  

Internet

Discussion 0
Questions 65

Allen works as a Software Developer for Mansoft Inc. He develops an application using Visual Studio .NET 2005. The application connects to a SQL Server database using a SqlConnection object named NewConnection. Allen creates a few stored procedures in the database. Sometimes an error occurs, when a user executes stored procedures. Allen wants to add an error-handling code to the application to handle errors that occur on executing stored procedures. Which of the following code segments will he use to accomplish this task?

Options:

A.  

try

{

NewConnection.Open();

}

catch(DBConcurrencyException exep)

{

//Error-handling code

}

B.  

try

{

NewConnection.Open();

}

catch(SqlException exep)

{

//Error-handling code

}

C.  

try

{

NewConnection.Open();

}

catch(DataException exep)

{

//Error-handling code

}

D.  

try

{

NewConnection.Open();

}

catch(InvalidCastException exep)

{

//Error-handling code

}

Discussion 0
Questions 66

You work as a Software Developer for ManSoft Inc. You create an application using Visual Studio .NET

2005. You write the following code snippet in the application:

int amt = 50;

String s = "John gave me " + amt + " dollars";

Console.WriteLine(s);

What will be the output of the above code?

Options:

A.  

"John gave me amt dollars"

B.  

"John gave me 50 dollars"

C.  

Integer variable cannot concatenate with the string

D.  

Invalid type cast exception

Discussion 0
Questions 67

You work as a Software Developer for ABC Inc. The company uses Visual Studio .NET as its application development platform. You are creating a Windows service application using the .NET Framework. The service is used to execute several tasks that require background processing. You do not want to actively manage threads in the service application, but you must make sure that security checks are performed during the execution of the task. What will you do to accomplish the task?

Options:

A.  

Use the ThreadPool.UnsafeQueueUserWorkItem method.

B.  

thread2 raises its own priority

C.  

Use the Thread.Start method.

D.  

Use the Thread.Resume method.

E.  

Use the ThreadPool.QueueUserWorkItem method.

Discussion 0
Questions 68

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.

The application is used to exchange structured and type information on the Web using Soap. You want to use the BinaryFormatter and SoapFormatter classes to support RPCs and serialization of a graph of objects. Which of the following interfaces will the BinaryFormatter and SoapFormatter classes implement to accomplish the task?

Each correct answer represents a part of the solution. Choose two.

Options:

A.  

IFormatter

B.  

IFormatable

C.  

IRemotingFormatter

D.  

IComparable

Discussion 0
Questions 69

Rick works as a Software Developer for GenTech Inc. He develops an application named App1 by using C# .NET. App1 uses a Microsoft SQL Server database named Database1. Database1 contains a table named Table1. Table1 stores data entered through App1. Rick wants App1 to notify every fifteen minutes about the new data entered. He wants to develop another application named App2, which reads Table1 every fifteen minutes and sends new data to the concerned department of the company.

App2 will run on a computer that is used by several users who continuously log on and log off from the network to perform miscellaneous tasks. Which of the following .NET application types will Rick use to accomplish the task?

Options:

A.  

Windows service

B.  

Windows Form

C.  

.NET remote object

D.  

XML Web service

Discussion 0
Questions 70

You work as a Software Developer for ABC Inc. You develop a Web application that contains several Web pages. The Web pages contain several Web server controls that implement validation controls for user input validation. Under which of the following circumstances will you perform user input validation programmatically for Web server controls?

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

Options:

A.  

When the validity of a control or a Web page is to be determined in the Page_Load event h andler.

B.  

When the user input validation data values are not set until run time.

C.  

When the server or validation controls are added during design time.

D.  

When the validity of a control or a Web page is to be determined in the Page_Init event ha ndler.

E.  

When the server or validation controls are added during run time.

Discussion 0
Questions 71

You work as a Software Developer for Mansoft Inc. You create an ASP.NET Web application named MyWebApp. You implement a security protocol to transmit secured data between a client and a server. You try to authenticate the client computer. However, you are unable to do so, and the AuthenticationException exception is thrown. Which of the following classes will you use to accomplish this task?

Each correct answer represents a complete solution. Choose two.

Options:

A.  

NegotiateStream

B.  

SslStream

C.  

Stream

D.  

AuthenticatedStream

Discussion 0
Questions 72

You work as a Software Developer for ABC Inc. The company uses Visual Studio .NET as its application development platform. You create a class library using the .NET Framework. The library will be used to open the NSCs of computers. Later, you will set up the class library to the GAC and provide it Full Trust permission. You write down the following code segments for the socket connections:

SocketPermission permission = new SocketPermission(PermissionState.Unrestricted);

permission.Assert();

A number of the applications that use the class library may not have the necessary permissions to open the network socket connections. Therefore, you are required to withdraw the assertion. Which of the following code segments will you use to accomplish the task?

Options:

A.  

permission.PermitOnly();

B.  

CodeAccessPermission.RevertDeny();

C.  

permission.Deny();

D.  

CodeAccessPermission.RevertAssert();

E.  

permission.Demand();

Discussion 0
Questions 73

Which of the following methods is not used to handle the SoapExtensions?

Options:

A.  

Configuration

B.  

Imperatively

C.  

Declaratively

D.  

Optimization

Discussion 0