<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
		<id>http://nfex.ru/index.php?action=history&amp;feed=atom&amp;title=Csharp%2FC_Sharp_by_API%2FSystem.Runtime.Serialization.Formatters.Binary%2FBinaryFormatter</id>
		<title>Csharp/C Sharp by API/System.Runtime.Serialization.Formatters.Binary/BinaryFormatter - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://nfex.ru/index.php?action=history&amp;feed=atom&amp;title=Csharp%2FC_Sharp_by_API%2FSystem.Runtime.Serialization.Formatters.Binary%2FBinaryFormatter"/>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=Csharp/C_Sharp_by_API/System.Runtime.Serialization.Formatters.Binary/BinaryFormatter&amp;action=history"/>
		<updated>2026-04-30T07:47:52Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://nfex.ru/index.php?title=Csharp/C_Sharp_by_API/System.Runtime.Serialization.Formatters.Binary/BinaryFormatter&amp;diff=4545&amp;oldid=prev</id>
		<title> в 15:31, 26 мая 2010</title>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=Csharp/C_Sharp_by_API/System.Runtime.Serialization.Formatters.Binary/BinaryFormatter&amp;diff=4545&amp;oldid=prev"/>
				<updated>2010-05-26T15:31:35Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Версия 15:31, 26 мая 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; style=&quot;text-align: center;&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
			</entry>

	<entry>
		<id>http://nfex.ru/index.php?title=Csharp/C_Sharp_by_API/System.Runtime.Serialization.Formatters.Binary/BinaryFormatter&amp;diff=4546&amp;oldid=prev</id>
		<title>Admin: 1 версия</title>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=Csharp/C_Sharp_by_API/System.Runtime.Serialization.Formatters.Binary/BinaryFormatter&amp;diff=4546&amp;oldid=prev"/>
				<updated>2010-05-26T12:11:15Z</updated>
		
		<summary type="html">&lt;p&gt;1 версия&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==BinaryFormatter.Deserialize==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt; &lt;br /&gt;
using System;&lt;br /&gt;
using System.Runtime.Serialization.Formatters.Binary;&lt;br /&gt;
using System.IO;&lt;br /&gt;
[Serializable]&lt;br /&gt;
public class BookRecord {&lt;br /&gt;
    public String title;&lt;br /&gt;
    public int asin;&lt;br /&gt;
    public BookRecord(String title, int asin) {&lt;br /&gt;
        this.title = title;&lt;br /&gt;
        this.asin = asin;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
public class DeserializeObject {&lt;br /&gt;
    public static void Main() {&lt;br /&gt;
        FileStream streamIn = new FileStream(@&amp;quot;book.obj&amp;quot;, FileMode.Open);&lt;br /&gt;
        BinaryFormatter bf = new BinaryFormatter();&lt;br /&gt;
        BookRecord book = (BookRecord)bf.Deserialize(streamIn);&lt;br /&gt;
        streamIn.Close();&lt;br /&gt;
        Console.Write(book.title + &amp;quot; &amp;quot; + book.asin);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==BinaryFormatter.Serialize==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt; &lt;br /&gt;
using System;&lt;br /&gt;
using System.Runtime.Serialization.Formatters.Binary;&lt;br /&gt;
using System.IO;&lt;br /&gt;
[Serializable]&lt;br /&gt;
public class BookRecord {&lt;br /&gt;
    public String title;&lt;br /&gt;
    public int asin;&lt;br /&gt;
    public BookRecord(String title, int asin) {&lt;br /&gt;
        this.title = title;&lt;br /&gt;
        this.asin = asin;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
public class SerializeObject {&lt;br /&gt;
    public static void Main() {&lt;br /&gt;
        BookRecord book = new BookRecord(&amp;quot;title&amp;quot;,123456789);&lt;br /&gt;
        FileStream stream = new FileStream(@&amp;quot;book.obj&amp;quot;,FileMode.Create);&lt;br /&gt;
        BinaryFormatter bf = new BinaryFormatter();&lt;br /&gt;
        bf.Serialize(stream, book);&lt;br /&gt;
        stream.Close();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==new BinaryFormatter()==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt; &lt;br /&gt;
using System;&lt;br /&gt;
using System.Collections.Generic;&lt;br /&gt;
using System.Runtime.Serialization;&lt;br /&gt;
using System.IO;&lt;br /&gt;
using System.Runtime.Serialization.Formatters.Binary;&lt;br /&gt;
[Serializable]&lt;br /&gt;
public class SampleCollection&amp;lt;T&amp;gt; : List&amp;lt;T&amp;gt; {&lt;br /&gt;
    private int _intData;&lt;br /&gt;
    private string _stringData;&lt;br /&gt;
    public SampleCollection(int intData, string stringData) {&lt;br /&gt;
        this._intData = intData;&lt;br /&gt;
        this._stringData = stringData;&lt;br /&gt;
    }&lt;br /&gt;
    public int IntVal {&lt;br /&gt;
        get { return this._intData; }&lt;br /&gt;
    }&lt;br /&gt;
    public string StrVal {&lt;br /&gt;
        get { return this._stringData; }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
public class TypeSafeSerializer {&lt;br /&gt;
    private TypeSafeSerializer() { }&lt;br /&gt;
    public static void AddValue&amp;lt;T&amp;gt;(String name, T value, SerializationInfo serInfo) {&lt;br /&gt;
        serInfo.AddValue(name, value);&lt;br /&gt;
    }&lt;br /&gt;
    public static T GetValue&amp;lt;T&amp;gt;(String name, SerializationInfo serInfo) {&lt;br /&gt;
        T retVal = (T)serInfo.GetValue(name, typeof(T));&lt;br /&gt;
        return retVal;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
public class MainClass {&lt;br /&gt;
    public static void Main() {&lt;br /&gt;
        SampleCollection&amp;lt;string&amp;gt; strList = new SampleCollection&amp;lt;string&amp;gt;(111, &amp;quot;Value1&amp;quot;);&lt;br /&gt;
        strList.Add(&amp;quot;Val1&amp;quot;);&lt;br /&gt;
        strList.Add(&amp;quot;Val2&amp;quot;);&lt;br /&gt;
        MemoryStream stream = new MemoryStream();&lt;br /&gt;
        BinaryFormatter formatter = new BinaryFormatter();&lt;br /&gt;
        formatter.Serialize(stream, strList);&lt;br /&gt;
        stream.Seek(0, SeekOrigin.Begin);&lt;br /&gt;
        SampleCollection&amp;lt;string&amp;gt; newList = (SampleCollection&amp;lt;string&amp;gt;)formatter.Deserialize(stream);&lt;br /&gt;
        Console.Out.WriteLine(newList.IntVal);&lt;br /&gt;
        Console.Out.WriteLine(newList.StrVal);&lt;br /&gt;
        foreach (string listValue in newList)&lt;br /&gt;
            Console.Out.WriteLine(listValue);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	</feed>