Page 1

Exam 70­536 study material Made available by Examsexpert.com

Free 70­536 Exam Preparation Questions  Exam  70­536    : TS: Microsoft .NET Framework 2.0—Application Development Foundation

For Latest 70­536 Exam Questions and study guides­ visit­ http://www.Examsexpert.com/70­536.html


Question: 1 You work as the application developer at Cer-Tech.com. Cer-Tech.com uses Visual Studio.NET 2005 as its application development platform. You are developing a .NET Framework 2.0 Windows application that uses a shared assembly personalizing the user interface of the application. The assembly in question is used by several other applications on the user's computer and any changes made to the user preferences in one application should be carried over to other applications. You are required to access the user's preferences for displaying the user interface. What should you do? A. The IsolatedStorageFile.GetUserStoreForDomain method should be used B. The IsolatedStorageFile.GetMachineStoreForDomain method should be used C. The IsolatedStorageFile.GetMachineStoreForAssembly method should be used D. The IsolatedStorageFile.GetUserStoreForAssembly method should be used Answer: D Question: 2 You work as the application developer at Hi-Tech.com. You have to develop an application named App01. When deployed, App01 will be used by numerous users on the same computer. App01 uses more than one assembly, and is configured to use isolated storage to store certain user information. You must create a new directory named UserInfo in the isolated storage area which is scoped to the current Microsoft Windows identity and assembly. Choose the code segment which will accomplish this task. A. IsolatedStorageFile store; store = IsolatedStorageFile.GetUserStoreForAssembly(); store.CreateDirectory ("UserInfo"); B. IsolatedStorageFile store; store = IsolatedStorageFile.GetMachineStoreForAssembly(); store.CreateDirectory ("UserInfo"); C. IsolatedStorageFile store; store = IsolatedStorageFile.GetUserStoreForDomain(); store.CreateDirectory ("UserInfo"); D. IsolatedStorageFile store; store = IsolatedStorageFile.GetMachineStoreForApplication(); store.CreateDirectory ("UserInfo"); Answer: A Question: 3 You work as the application developer at Cer-Tech.com. Cer-Tech.com uses Visual Studio.NET 2005 as its application development platform. You are developing a .NET Framework 2.0 banking Windows Forms application and are busy working on a function that retrieves the images of cancelled checks and displays them on the from. You currently have access to a method that reads the images from Microsoft SQL server as a series of bytes. You are required to select a class that allows you to transfer the image from SQL Server to the Windows Forms application whilst your solution reduces the need of a temporary buffers and files. What should you do? A. Use the MemoryStream class. B. Use the NetworkStream class. C. Use the FileStream class. D. Use the BufferedStream class. Answer: A Question: 4 Which of the following create a FileStream for writing when you want to open an existing file or create a new one if it doesn??t exist? (Choose all that apply.) A. Create a new instance of the FileStream class, with the FileMode option of OpenOrCreate. B. Call File.Create to create the FileStream. C. Call File.Open with the FileMode option of OpenOrCreate. For Latest 70­536 Exam Questions and study guides­ visit­ http://www.Examsexpert.com/70­536.html


D. Call File.Open with the FileMode option of Open. Answer: A, C Question: 5 Which of the following interfaces should you implement to enable you to run a method after an instance of your class is serialized? A. IFormatter B. ISerializable C. IDeserializationCallback D. IObjectReference Answer: C Question: 6 You work as the application developer at Hi-Tech.com. You are developing a new class named Class01. Class01 contains a method named Method01, and a number of child objects which are serializable. Method01 will execute actions on all child objects. You want make to certain that Method01 is applied whenever Class01 and its associated child objects are rebuilt. Choose the two actions which you should perform next? Each correct answer presents only part of the complete answer. A. Apply the OnDeserializing attribute to the Method01 method. B. Define Class01 to implement the IDeserializationCallback interface. C. Define Class01 to inherit from the ObjectManager class. D. Apply the OnSerialized attribute to Method01. E. Create a GetObjectData method that calls Method01. F. Create an OnDeserialization method that calls Method01. Answer: B, F Question: 7 You work as the application developer at Cer-Tech.com. Cer-Tech.com uses Visual Studio.NET 2005 as its application development platform. You are developing a .NET Framework 2.0 application and create the following class in the application: Public Class Model Public Name As String End Class You are required to deserialize the data in testmodel.xml in an object of the Model type. The contents of testmodel.xml sre shown below, if you encounter unknown elements the method named Model_Unknown should be executed: <? xml version="1.0" encoding="utf-8"?><Model xmlns:xsi=http://www. Cer-Tech.com/XMLSchemainstance xmlns:xsd="http://www. Cer-Tech.com/XMLSchema"> <Number>123</Number> <Name>Model1</Name> <Style>Business</Style><Size>Large</Size></Model> What should you do? A. Private Sub DeserializeModel (ByVal filename As String) Dim xSerial As XmlSerializer = New XmlSerializer (GetType (Model)) AddHandler xSerial.UnknownElement, AddressOf Model_Unknown Using fStream As FileStream = New FileStream (filename, FileMode.Open) Dim testModel As Model = CType (xSerial.Deserialize (fStream), Model) End Using End Sub B. Private Sub DeserializeModel (ByVal filename As String) Dim xSerial As XmlSerializer = New XmlSerializer (GetType (Model)) Using fStream As FileStream = New FileStream (filename, FileMode.Open) Dim testModel As Model = CType (xSerial.Deserialize (fStream), Model) End Using End Sub C. Private Sub DeserializeModel (ByVal filename As String) Dm xSerial As XmlSerializer = New XmlSerializer (GetType (Model)) AddHandler xSerial.UnknownAttribute, AddressOf Model_Unknown Using fStream As FileStream = New FileStream (filename, FileMode.Open) Dim testModel As Model = CType (xSerial.Deserialize (fStream), Model) End Using End Sub D. Private Sub DeserializeModel (ByVal filename As String) Dim xSerial As XmlSerializer = New XmlSerializer (GetType (Model)) AddHandler xSerial.UnreferencedObject, AddressOf Model_Unknown Using fStream As FileStream = New FileStream (filename, FileMode.Open) Dim testModel As Model = CType (xSerial.Deserialize (fStream), Model) End Using End Sub For Latest 70­536 Exam Questions and study guides­ visit­ http://www.Examsexpert.com/70­536.html


Answer: A Question: 8 You work as the application developer at Hi-Tech.com. You create a class library that contains a class hierarchy. The class hierarchy is specified in this code segment: 01 Public Class Group 02 Public Employees As Employee() 03 End Class 04 05 Public Class Employee 06 Public Name As String 07 End Class 08 09 Public Class Manager 10 Inherits Employee 11 Public Level As Integer 12 End Class Line numbers are only shown above for reference purposes. You create an instance of the Group class, and then populate the fields of the Group class's instance. You use the Serialize method of the XmlSerializer class to serialize the instance. You realize that the attempt is unsuccessful when you receive InvalidOperationException, and an error message which states this: "There was an error generating the XML document." You must perform the necessary configuration which will allow you to use the Serialize method of the XmlSerializer class to serialize the instances. You want the XML output to include elements for all public fields in the class hierarchy. What should you do to achieve your goal in these circumstances? A. Add this code segment between lines 01 and 02 of the code segment: <XmlArrayItem(Type:=GetType(Employee))> _ <XmlArrayItem(Type:=GetType(Manager))> _ B. Add this code segment between lines 01 and 02 of the code segment: <XmlElement(Type:=GetType(Employee))> _ C. Add this code segment between lines 01 and 02 of the code segment: <XmlArray(ElementName:="Employees")> _ D. Add this code segment between lines 05 and 06 of the code segment: <XmlElement(Type:=GetType(Employee))> And Add this code segment between lines 10 and 11 of the code segment: <XmlElement(Type:=GetType(Manager))> Answer: A Question: 9 You work as an application developer at Cer-Tech.com. You have been asked by you superiors at CerTech.com to create a child application domain. The new child application domain has to specify a different assembly path than that of the parent application domain. You need to ensure that your solution meets Cer-Tech.com's requirements. What should you do? A. Use the following code: AppDomainSetup domainSetup = new AppDomainSetup (); domainSetup.ApplicationName = @"C:\Program Files\ChildApp"; AppDomain.CreateDomain ("ChildDomain", AppDomain.CurrentDomain.Evidence, domainSetup); B. Use the following code: AppDomainSetup domainSetup = new AppDomainSetup (); domainSetup.ApplicationBase = @"C:\Program Files\ChildApp"; AppDomain.CreateDomain ("ChildDomain", AppDomain.CurrentDomain.Evidence, domainSetup); C. Use the following code: AppDomainSetup domainSetup = new AppDomainSetup (); domainSetup.ConfigurationFile = @"C:\Program Files\ChildApp"; AppDomain.CreateDomain ("ChildDomain", AppDomain.CurrentDomain.Evidence, domainSetup); D. Use the following code: AppDomainSetup domainSetup = new AppDomainSetup (); domainSetup.CachePath = @"C:\Program Files\ChildApp"; AppDomain.CreateDomain ("ChildDomain", AppDomain.CurrentDomain.Evidence, domainSetup); Answer: B Question: 10 You work as the application developer at Cer-Tech.com. Cer-Tech.com uses Visual Studio.NET 2005 as its application development platform. You are developing a .NET Framework 2.0 application class library. You make used of a custom class named TestResource in the application, you create two instances of the TestResource class. Dim CLASS01, CLASS02 As TestResouce 'Additional code goes here You want object CLASS02 to be assigned to object CLASS01 if the values of the CLASS01 object is Nothing. The code may be shared by multiple threads. You are required to write code that is threadsafe and provides the best performance. What should you do? A. System.Threading.Monitor.TryEnter (Me) If (CLASS01 Is Nothing) Then CLASS01 = CLASS02 System.Threading.Monitor.Exit (Me) For Latest 70­536 Exam Questions and study guides­ visit­ http://www.Examsexpert.com/70­536.html


B. System.Threading.Interlocked.Exchange (CLASS01, CLASS02) C. If (CLASS01 Is Nothing) Then SyncLock (Me) If (CLASS01 Is Nothing) Then CLASS01 = CLASS02 End SyncLock End If D. System.Threading.Interlocked.CompareExchange (CLASS01, CLASS02, Nothing) Answer: D Question: 11 You work as the application developer at Cer-Tech.com. You make use of Visual Studio 2005 as your application development platform. You are developing a .NET Framework 2.0 applicationand write the code below as your own code: Public Class Book Public Name As String End Class Public Class Library <XmlAray("ID1")> _ <XmlArayItem("ID2")> _ Public Book As Book() End Class You are required to create an object of the Library type and serialize it to disk in a file named Certkiller books.xml and write the following code: Dim books As Book() = New Book() {New Book(), New Book(), New Book()} books(0).Name = "Book Name 1" books(1).Name = "Book Name 2" books(2).Name = "Book Name 3" Dim library As Library = New Library() library.Books = books Dim ckSerializer As XmlSerializer = New XmlSerializer(GerType(library))Using ckWriter As StreamWriter = New StreamWriter(" Certkiller books.xml") ckSerializer.Serialize(ckWriter, library) End Using You are required to choose from the following selection which output will be generated by the program. What should you do? A. <Library> <ID1> <Book> <ID2>Book Name 1</ID2> </Book> <Book> <ID2>Book Name 2</ID2> </Book> <Book> <ID2>Book Name 3</ID2> </Book> </ID1> </Library> B. <Library> <Books> <ID1> <ID2>Book Name 1</ID2> </ID1> <ID1> <ID2>Book Name 2</ID2> </ID1> <ID1> <ID2>Book Name 3</ID2> </ID1> </Books> </Library> C. <Library> <ID2> <ID1> <Name>Book Name 1</Name> </ID1> <ID1> <Name>Book Name 2</Name> </ID1 <ID1> <Name>Book Name 3</Name> </ID1> </ID2> </Library> D. <Library> <ID1> <ID2> <Name>Book Name 1</Name> </ID2> <ID2> <Name>Book Name 2</Name> </ID2> <ID2> <Name>Book Name 3</Name> </ID2> </ID1> </Library> Answer: D

For complete Exam 70-536 Training kits and Self-Paced Study Material Visit: http://www.Examsexpert.com/70-536.html

For Latest 70­536 Exam Questions and study guides­ visit­ http://www.Examsexpert.com/70­536.html


www.Examsexpert.com

For Latest 70­536 Exam Questions and study guides­ visit­ http://www.Examsexpert.com/70­536.html

Exam 70-536 Preparation Questions  

ExamsExpert providing one of the best certification preparation services. A 100% success guaranteed study material that ensures your success...

Read more
Read more
Similar to
Popular now
Just for you