Mcts Questions and Answers
Mcts Questions and Answers
1)You have been hired by a small software company to help with the development of their internal .Net reporting applications. You have been given the task of assessing the security model of the company's application, in particular the classes derived from System.Security.CodeAccessPermission. Which one of the .NET framework permissions should be used to gain insight into the users credentials?
Use the ActiveX Library Importer tool to create and sign a PIA for your component Use the Type Library Importer tool to create and sign a PIA for your component Set a reference to your component from any Visual Studio .NET project to quickly create a RCW for you component Create an extra class that uses the Platform Invoke to call methods from your component
As the leading developer of your Visual Studio 2005 application you have been given the task of managing the storage of message data. You have opted to use the Queue class to store messages as they are delivered to your application. Which method of the Queue class should you use to store a new message string at the end of your queue object?
MyQueue.Enqueue(). To add a new object to the end of the queue you must use the Enqueue method. The other choices do not satisfy the requirement. Dequeue removes the object at the end of the list, Peek returns the first object and Clone creates a copy of the queue.
Your new .Net application needs to store a large amount of data to a disk file for permanent storage. Space is important and you want to write the data in a compact format but it does not need to be easily readable by humans. Which class is the best choice to accomplish this?
You are designing a new .Net application that will be used by clients in a large number of different countries. The application allows company's to store geographical information and then share that information with other company's in different countries. When storing this information ready to publish, which culture should you use?
The invariant culture The en-EN culture The culture from the Thread.CurrentThread.CurrentCulture A random culture
The invariant culture. The invariant culture is ideal for situations where the information is not presented to the end user but may need to be used from many different locals (languages). The invariant culture is a culture-neutral storage format.
You are working on a large .Net project with a group of work mates. The project is time critical and you need to think fast. As part of the project you have created an order entry system using Visual Studio 2005 and you want to email clients automatically when their orders have been processed. Which class is best suited to sending electronic mail using the .NET framework?
HttpClient
Your new Visual Studio 2005 application has been designed to allow users to perform audit operations on their network. Your application uses the .Net namespace to create mail message and attach log files of network activity. What type of content can you specify for the Attachment method?
You need to control the tracing and debug output of your .Net application but you really don't want to recompile your code because it will be delivered to an offshore test client. Which class could you use to achieve this?
You are working on a new .Net application for a small software company. The application will use a collection from the Systems.Collection namespace to store key-
value pairs. However, you want the list to be ordered by key and you also want to be able to pick values from the list by using key name or index. Which collection would be the best choice?
You have been hired as the database developer for a small software company. Your organization would like you to send information from their internal database to external customers using XML documents. Currently, you have custom classes that store this information. Which class should you use to write the XML documents?
You are working with a group of clients to develop a .Net application to monitor their legacy applications. However sometimes your application may encounter errors. So you therefore want to develop an error reporting process that is robust, requires a minimum amount of code and is also easily readable by the clients system administrators. Which one of the following would be the best choice for this scenario?
You have recently joined a .Net development team based in the heart of the city. One of their applications requires the use of OLE DB data sources to store specific data about their clients business workflows. Which .Net security feature should be used to ensure the code has this ability?
You are designing a new .Net application that primarily uses the System.IO namespace to manipulate different files. You require the options to delete, move, copy and rename files. Which of the following methods of the FileInfo class does NOT exist?
During development of your .Net project you added the following statement to the Load event handler of the main form of your windows application:
TextWriterTraceListener listens only to the messages generated by the Trace class All trace messages are stored in a file on the users SYSTEM32 folder TextWriterTraceListener listens only to the messages generated by the Debug class TextWriterTraceListener listens to all messages generated by both the Debug and Trace classes
TextWriterTraceListener listens to all messages generated by both the Debug and Trace classes. When you add a listener to the Trace.Lsiteners collection, it will listen to messages generated both by Trace and Debug classes.
You have been hired by Accelerated Ideas to help with our .Net projects. One of our projects created using Visual Studio 2005, serializes objects into XML for storage in an XML document. Which XmlSerializer method should you use to serialize the objects in your application into an XML document?
You are designing a custom class that performs complex algorithm calculations. During these calculations the code allocates large chunks of memory. Rather than wait for the runtime to free the memory resources, you would like developers who use your class to be able to free resources on demand. Which interface should you implement?
IComparable
As part of a sizable .Net team you are responsible for working on state of the art .Net solutions. The current project you are working on makes extensive use of the IO namespace. You have reviewed this application and are considering alternative options and possibilities. As part of this review you need to know which one of the following classes interacts with the file system?
Use the Unicode.GetChars method Use the Unicode.GetBytes method Use the UTF7Encoding.GetChars method Use the UTF7Encoding.GetBytes method
Correct answer! Use the UTF7Encoding.GetBytes method. You should use the GetBytes method of the encoding that you want to perform the conversion into.
You have recently joined a new .Net development team based in the heart of the city. Your first task is to review a colleague's code for security vulnerabilities.
Which of the System.Security.Cryptography classes would indicate that the developer had chosen to use weak encryption that could potentially be cracked in a short amount of time?
You are designing a new .Net application for a local weather station to predict weather forecasts. The application contains a huge amount of complex methods, one of which accepts an object array and proceeds to either update an existing record in the database table or add a new one. However when you run the application you frequently receive the exception of type InvalidCastException. What does the error mean?
You cannot pass an array of objects as a variable type None of these The data is not correct for the column being updated The variables should first be converted to a collection before calling the method
The data is not correct for the column being updated. This error is thrown when invalid casting or explicit conversion is performed on data from one type to another.