C# Question Answers

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+?

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

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?

Which interface should you implement to enable sorting a class?

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?

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?

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

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

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

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?

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

Which method of CodeGroup class will duplicate a code group?

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

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

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

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

Which enumeration specifies the text encoding when applying the DllImport attribute

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?

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?

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?

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?

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

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

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

Which class represents an e-mail message?

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

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?

Which class represents an application domain?

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

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

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

No comments: