Deck 3 Flashcards

1
Q

Which feature protects computers from running untrusted applications?

A

Code Access security

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

The SecureString class:

A

Protects data from being revealed during garbage collection.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Which two methods can you use to load an assembly? (Each correct answer presents a complete solution. Choose two.)

A

LoadModule(String, ByteQ)
—–AND—–
Load(String)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the purpose of strong naming?

A

To assign a globally unique key to the assembly.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Which standard allows data types to be interchanged among all Common Language Infrastructure (CLI) programming languages?

A

Common Type System (CTS)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

You have created a program that writes status updates into a file. You want to modify the file. You need to ensure that other users can view the file while it is being modified. Which permission should you use to open the file?

A

FileShare.Read

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Which two classes in the .NET Framework allow you to delete a file? (Each correct answer presents a complete solution. Choose two.)

A

System.IO.FileInfo
—–AND—–
System.IO.File

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

You want to substitute values in a string that is displayed on the console. Which code fragment will display “Hello, World”?

A

Console.WriteLine(“Hello, {0}”, “World”);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Where are the command line arguments stored for a console application?

A

In a string array parameter that is passed to the Main method.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

You create a class that uses unmanaged resources. You need to ensure that users of the class can explicitly release resources when the instance of the class is no longer required. Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)

A
Use a class destructor that is called from within the Dispose method.
-----AND-----
Implement the IDisposable interface.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Value type variables are stored in the:

A

Stack

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Managed code manages:

A

Processor optimization.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What does the .NET Framework use to pass data between managed and unmanaged code?

A

Marshaling

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Which should you use to call a class written in C# from a program written in Microsoft Visual Basic .NET?

A

The Visual Basic .NET syntax

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Type-safe code accesses only the memory locations:

A

It is authorized to access.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

A type-safe language prevents:

A

Access to arbitrary memory locations.

17
Q

How does managed .NET code use an unmanaged COM object?

A

The CLR creates a runtime callable wrapper (RCW) that acts as a proxy for the unmanaged object.

18
Q

Type-safe code prevents:

A

Unauthorized memory access.

19
Q

You need to encrypt data by using a public key and a private key. Which .NET class should you use?

A

DSACryptoServiceProvider

20
Q

You want to enable access to files and folders by using the .NET Framework. Which security class should you use?

A

FileIOPermission