<?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=ASP.Net%2FXML%2FBinary</id>
		<title>ASP.Net/XML/Binary - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://nfex.ru/index.php?action=history&amp;feed=atom&amp;title=ASP.Net%2FXML%2FBinary"/>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=ASP.Net/XML/Binary&amp;action=history"/>
		<updated>2026-04-30T00:17:18Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://nfex.ru/index.php?title=ASP.Net/XML/Binary&amp;diff=1856&amp;oldid=prev</id>
		<title> в 15:30, 26 мая 2010</title>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=ASP.Net/XML/Binary&amp;diff=1856&amp;oldid=prev"/>
				<updated>2010-05-26T15:30:47Z</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:30, 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=ASP.Net/XML/Binary&amp;diff=1857&amp;oldid=prev</id>
		<title>Admin: 1 версия</title>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=ASP.Net/XML/Binary&amp;diff=1857&amp;oldid=prev"/>
				<updated>2010-05-26T11:51:39Z</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;==Write Binary (Image) Data to XML==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;%@ Page Language=&amp;quot;C#&amp;quot; %&amp;gt;&lt;br /&gt;
&amp;lt;%@ Import Namespace=&amp;quot;System.Xml&amp;quot; %&amp;gt;&lt;br /&gt;
&amp;lt;%@ Import Namespace=&amp;quot;System.IO&amp;quot; %&amp;gt;&lt;br /&gt;
&amp;lt;script runat=&amp;quot;server&amp;quot;&amp;gt;&lt;br /&gt;
    void Page_Load(object sender, EventArgs e)&lt;br /&gt;
    {&lt;br /&gt;
//        string xmlFilePath = @&amp;quot;C:\EmployeesNew.xml&amp;quot;;&lt;br /&gt;
//        string imageFileName = @&amp;quot;C:\yourBinaryFileName.jpg&amp;quot;;&lt;br /&gt;
        string xmlFilePath = MapPath(&amp;quot;EmployeesNew.xml&amp;quot;);&lt;br /&gt;
        string imageFileName = MapPath(&amp;quot;3.ico&amp;quot;);&lt;br /&gt;
        try&lt;br /&gt;
        {&lt;br /&gt;
            using (XmlWriter writer = XmlWriter.Create(xmlFilePath))&lt;br /&gt;
            {&lt;br /&gt;
                writer.WriteStartDocument(false);&lt;br /&gt;
                writer.WriteStartElement(&amp;quot;employee&amp;quot;);&lt;br /&gt;
                writer.WriteAttributeString(&amp;quot;id&amp;quot;, &amp;quot;1&amp;quot;);&lt;br /&gt;
                writer.WriteStartElement(&amp;quot;image&amp;quot;);&lt;br /&gt;
                writer.WriteAttributeString(&amp;quot;fileName&amp;quot;, imageFileName);&lt;br /&gt;
                //Get the size of the file&lt;br /&gt;
                FileInfo fi = new FileInfo(imageFileName);&lt;br /&gt;
                int size = (int)fi.Length;&lt;br /&gt;
                //Read the JPEG file&lt;br /&gt;
                byte[] imgBytes = new byte[size];&lt;br /&gt;
                FileStream stream = new FileStream(imageFileName, FileMode.Open);&lt;br /&gt;
                BinaryReader reader = new BinaryReader(stream);&lt;br /&gt;
                imgBytes = reader.ReadBytes(size);&lt;br /&gt;
                reader.Close();&lt;br /&gt;
                //Write the JPEG data&lt;br /&gt;
                writer.WriteBinHex(imgBytes, 0, size);&lt;br /&gt;
                writer.WriteEndElement();&lt;br /&gt;
                writer.WriteEndElement();&lt;br /&gt;
                writer.WriteEndDocument();&lt;br /&gt;
                writer.Flush();&lt;br /&gt;
                lblResult.Text = &amp;quot;File is written successfully&amp;quot;;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
        catch (Exception ex)&lt;br /&gt;
        {&lt;br /&gt;
            lblResult.Text = &amp;quot;An Exception occurred: &amp;quot; + ex.Message;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;html xmlns=&amp;quot;http://www.w3.org/1999/xhtml&amp;quot; &amp;gt;&lt;br /&gt;
&amp;lt;head runat=&amp;quot;server&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;title&amp;gt;Writing Images using XmlWriter&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
    &amp;lt;form id=&amp;quot;form1&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;div&amp;gt;&lt;br /&gt;
        &amp;lt;asp:label id=&amp;quot;lblResult&amp;quot; runat=&amp;quot;server&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
    &amp;lt;/form&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/html&amp;gt;&lt;br /&gt;
           &lt;br /&gt;
       &amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	</feed>