C# QA Part - Six

Which class represents a hash algorithm used strictly for data integrity?
The MD5 Class

Which class grants a dynamically-generated FileIOPermission to the directory from which the code is executed?
The FileCodeGroup class

Which enumeration indicated whether an access rule is to allow or deny access?
The AccessControlType enumeration

What should you apply to a method for it to execute while an object is converted to a stream of bytes?
OnSerializing attribute to the method

Which class should you use to paint filled shapes and text in GDI+?
Brush

Which assembly attribute should you apply to indicate the keys used when compiling a strong-named assembly?
AssemblyKeyFile

Which property of the Process class returns the name of the computer on which the process is running?
MachineName property

Which method of the CodeGroup class will determine the policy for the code group based on the specified evidence?
Resolve method

Which two values of the ConfiguratinoUserLevel enumeration indicate a user-specific configuration?
PerUserRoaming and PerUserRomaingAndLocal values.

When should you use a queue?
When organizing elements according to the First In, First Out (FIFO) method

Which attribute should you apply to a parameter or return type to force marshalling into a specific COM data type?
MarshalAs attribute

Which method should you place a core code in a Windows Service?
OnStart

Which interface should you implement to enable sorting a class?
IComparable

Which command line tool allows users to modify security permissions, permission sets and code groups for an assembly?
Caspol.exe tool

Which method is used to run a thread?
Start

Which permission class controls access to managed types at runtime?
The ReflectionPermission class

Which property of the IPrincipal interface should you use to retrieve the underlying identity?
Identity

Which method should you invoke on the ThreadPool class to add a delegate?
QueueUserWorkItem

Which property of the Attachment class is used to the MIME type of an e-mail attachment?
ContentType

Which enumeration indicates the type of cultures installed on a local machine?
CultureTypes

How should you alter the name of an XML element generated from a field?
You should apply the XmlElement attribute and specify the new name.

Which property of the Process class returns all libraries loaded by the current process?
Modules

Which method of the LinkedList class should be invoked to add an object to the beginning?
AddFirst

Which method of CodeGroup class will duplicate a code group?
Copy

Which property of the AppDomain class should you use to access the startup path?
BaseDirectory

Which method of the AppDomain class will create an application domain?
CreateDomain

Which class represents the file instance on a computer’s file system?
FileInfo

Which class should you use to access information about all drives on a local system?
DriveInfo

Which enumeration specifies the text encoding when applying the DllImport attribute
Charset

What is an exception?
An exception is an abnormal condition at runtime resulting from an error or unexpected operation

Which method of the Assembly class should you invoke to retrieve the assembly instance that invoked the currently executing code?
GetCallingAssembly

How do you invoke the method(s) to which a delegate references?
Invoke the Invoke method, specifying the arguments required by the delegate

What should you apply to a class to indicate its objects can be converted into a contiguous stream of bytes?
Serializable

What is WQL?
WMI Query Language a subset of SQL, specifically designed to query managed WMI instances.

Which attribute should you apply to uniquely identify a COM interface or class in the registry?
GUID

Which class represents specific managed instances available through WMI (Windows Management Instrumentation)?
ManagementObject class

Which CharSet enumeration value is the default text encoding when using WindowsNT,Win2K,WinXP,Win2003 server?
CharSet.Unicode value

What should you apply to a field if its value is not required during deserialization?
OptionalField

Which CharSet enumeration value is the default text encoding when using Win9x, Windows Me?
Charset.Ansi

Which method of the FileStream class should be invoked when work is completed with a file’s contents?
Close


Which class should you use to retrieve methods of a dynamically loaded type at runtime?
MemberInfo

Which class represents an e-mail message?
MailMessage

Which interface should you implement when defining a class responsible for the format of serialized data types?
IFormatter

What object is required when invoking either the Write or Read of the GZipStream or DeflateStream classess?
Byte Array

When defining a CLR class, which two ways can you expose its methods to COM clients?
Apply Classinterface attribute or implement a custom class interface

Which method of the StreamWriter class should you invoke to clear all buffers and force data in the buffer to be written?
Flush

Which class represents an application domain?
AppDomain

Which element in the application configuration file should you use to specify BooleanSwitch or TraceSwitch objects?
Switches

When exposing managed methods to COM, what access modifier must you apply?
Public

Which class should you use inside a method to restrict access based upon an identity or role membership?
PrincipalPermission

No comments: