Click here to Skip to main content
15,917,176 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi to all!

I am a novice programmer which is developing desktop applications.

Can you help me make a serializable file that can be included in my application which contains the computer details such as ComputerId, ProcessorId, Manufacturer, and etc. and also the duration of the application usage.

Thank you ...
Posted
Comments
[no name] 7-Jul-13 21:10pm    
Yes I am quite sure that someone could help you.... you would have to come up with some sort of a question or describe some sort of a problem though.
Sergey Alexandrovich Kryukov 7-Jul-13 22:18pm    
What is "serializeable file"? :-) The question does not seem to make sense.
—SA

1 solution

Hi,
using System.Runtime.Serialization;

using System.Runtime.Serialization.Formatters.Binary;

FileStream fs = new FileStream(@"C:\ABC.txt", FileMode.Create);

binfor = new BinaryFormatter();

binfor.Serialize(fs, DATATOSERIALIZE);

fs.Close();

And For XML Serialization

using System.Runtime.Serialization;

using System.Runtime.Serialization.Formatters.Soap;

fs = new FileStream(@"C:\ABC.xml", FileMode.Create);

soafor = new SoapFormatter();

soafor.Serialize(fs, DATATOSERIALIZE);

fs.Close();
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900