C# Interview Questions and Answers
<< Previous Question Next Question >>
 Question: 306 Page Views: 

How do you serialize an object using BinnaryFormater?



Posted By: Avi Date: 14 October 2010 05:13:46 PM
 Answer:

FileStream fs = new FileStream(“file”, FileMode.Create); BinaryFormatter frm = new BinaryFormatter(); frm.Serialize(fs, obj); fs.Close();


Posted By: avibtech


Date: 14 October 2010 05:13:46 PM
Post a better Answer if you have
 
(Will show your Gravatar icon)  
  Country flag

Loading
Enter the text as shown in the image Nwo5ZV
Related Questions
C# : What is meant by an Iterator?

What is meant by an Iterator?

Iterator is a method, get accesor or an operator which performs custom iterations over an array or ....
Category: C# Date: 10/1/2010 11:38:31 AM
C# : Is there any way tp prevent a class being inherited , so that it can't act as a base class to some other class?

Is there any way tp prevent a class being inherited , so that it can't act as a base class to some o....

Yes, it is possible. This can be done with the help of the sealed keyword. It can be done as follows....
Category: C# Date: 10/1/2010 11:37:31 AM
C# : Why an error occurs when one tries to declare a method without specify its return type?

Why an error occurs when one tries to declare a method without specify its return type?

If the return type is not included at the time of declaration of the method, the compiler thinks it ....
Category: C# Date: 10/1/2010 11:36:31 AM
C# : In one Try block what is the need of multiple  Catch Blocks?

In one Try block what is the need of multiple Catch Blocks?

If there is one catch block in the try block then it will catch every exception but it will not be c....
Category: C# Date: 10/1/2010 11:35:31 AM
C# : Write the syntax of calling an overloaded constructor within a constructor?

Write the syntax of calling an overloaded constructor within a constructor?

Syntax:- class sum1 { sum1(int count) { } } class sum0 : sum1 { sum0() : sum1(2) // calling bas....
Category: C# Date: 10/1/2010 11:34:31 AM