Click here to Skip to main content
15,921,371 members
Home / Discussions / C#
   

C#

 
GeneralRe: (null) values in datagrid Pin
Daniel Turini31-Oct-03 2:18
Daniel Turini31-Oct-03 2:18 
GeneralRe: (null) values in datagrid Pin
misiek31-Oct-03 2:59
misiek31-Oct-03 2:59 
GeneralRe: (null) values in datagrid Pin
Braulio Dez31-Oct-03 2:59
Braulio Dez31-Oct-03 2:59 
GeneralCrystal Export to Excel Pin
akorolev1030-Oct-03 20:17
akorolev1030-Oct-03 20:17 
GeneralWritng objects to file Pin
Itanium30-Oct-03 18:34
Itanium30-Oct-03 18:34 
GeneralRe: Writng objects to file Pin
MKlucher30-Oct-03 19:08
MKlucher30-Oct-03 19:08 
GeneralRe: Writing objects to file Pin
Itanium30-Oct-03 19:43
Itanium30-Oct-03 19:43 
GeneralRe: Writng objects to file Pin
Corinna John30-Oct-03 19:50
Corinna John30-Oct-03 19:50 
Writing objects into a stream is called "Serialization", C# contains two different foramtters:

System.Runtime.Serialization.Formatters.Binary.BinaryFormatter for binary formatting, and
System.Runtime.Serialization.Formatters.Soap.SoapFormatter for XML formatting.

The SerializableAttribute marks a class as serializable:

[Serializable()]
public class MyClass{
public int a;
public int b;
public string c;
}

To write an object of that class to a file stream, you can use the Serialize-method:

BinaryFormatter formatter = new BinaryFormatter();
FileStream stream = new FileStream(myFileName, FileMode.Create);
formatter.Serialize(stream, obj);

Later you can read teh object from the file with Deserialize():
MyClass obj = (MyClass)formatter.Deserialize(stream);


Itanium wrote:
sorry for my bad English.

Sorry for my even worse English. Have I understood the question, or is this an off-topic posting? Wink | ;)
GeneralRe: Writng objects to file Pin
Itanium30-Oct-03 21:44
Itanium30-Oct-03 21:44 
GeneralCommand Bars Pin
monrobot1330-Oct-03 17:37
monrobot1330-Oct-03 17:37 
GeneralRe: Command Bars Pin
J. Dunlap30-Oct-03 20:59
J. Dunlap30-Oct-03 20:59 
GeneralNaming inconsistencies in the BCL Pin
Jeff Varszegi30-Oct-03 10:37
professionalJeff Varszegi30-Oct-03 10:37 
GeneralRe: Naming inconsistencies in the BCL Pin
Nick Parker30-Oct-03 11:51
protectorNick Parker30-Oct-03 11:51 
GeneralRe: Naming inconsistencies in the BCL Pin
Jeff Varszegi30-Oct-03 12:23
professionalJeff Varszegi30-Oct-03 12:23 
GeneralRe: Naming inconsistencies in the BCL Pin
Nick Parker30-Oct-03 13:26
protectorNick Parker30-Oct-03 13:26 
GeneralRe: Naming inconsistencies in the BCL Pin
Heath Stewart30-Oct-03 12:32
protectorHeath Stewart30-Oct-03 12:32 
GeneralRe: Naming inconsistencies in the BCL Pin
Jeff Varszegi30-Oct-03 12:42
professionalJeff Varszegi30-Oct-03 12:42 
Generalbyte[] cast to a string Pin
Tym!30-Oct-03 8:07
Tym!30-Oct-03 8:07 
GeneralRe: byte[] cast to a string Pin
J. Dunlap30-Oct-03 8:21
J. Dunlap30-Oct-03 8:21 
GeneralRe: byte[] cast to a string Pin
Tym!30-Oct-03 10:34
Tym!30-Oct-03 10:34 
GeneralRe: byte[] cast to a string Pin
Jörgen Sigvardsson30-Oct-03 9:41
Jörgen Sigvardsson30-Oct-03 9:41 
GeneralRe: byte[] cast to a string Pin
Tym!30-Oct-03 10:48
Tym!30-Oct-03 10:48 
GeneralRe: byte[] cast to a string Pin
Jörgen Sigvardsson30-Oct-03 11:20
Jörgen Sigvardsson30-Oct-03 11:20 
GeneralRe: byte[] cast to a string Pin
Tym!30-Oct-03 12:28
Tym!30-Oct-03 12:28 
GeneralRe: byte[] cast to a string Pin
Jörgen Sigvardsson30-Oct-03 12:32
Jörgen Sigvardsson30-Oct-03 12:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.