NET - Explain how to use XML to deserialize an object.

Explain how to use XML to deserialize an object.

- Deserialization is the process of taking XML-formatted data and converting it to a .NET framework object.

- The XmlSerializer class is used to deserialize the string to an instance of the Test class.

- To obtain a suitable stream that can be passed into the XmlSerializer's constructor, a StringReader (from the System.IO namespace) is declared.

Example:

FileStream fStream = new FileStream(filename, FileMode.Open);

XmlReader rdr = new XmlTextReader(fStream);

Class1 cls1;

cls1 = (Class1) srl.Deserialize(rdr);

- The XML stream is saved to a file and the same file is then read back and reconstructed into a copy of the original object using the Deserialize method.

- To deserialize the objects, call the Deserialize method with the FileStream as an argument.
NET - Debug Build vs. Release build in .NET
Debug Build vs. Release build in .NET - In Debug mode, You can use the development environment's integrated debugging functions.......
NET - What is Code Access Security? Describe the purpose of CAS.
What is Code Access Security? Describe the purpose of CAS - Code access security is a mechanism to help protect computer systems from malicious code......
NET - What is a Permission? What is a Permission Set?
What is a Permission? What is a Permission Set? - Permission is a rule to enforce restriction on a piece of managed code.......
Post your comment