using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Xml.Serialization;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
TextBox tb = new TextBox();
tb.Multiline = true;
tb.Dock = DockStyle.Fill;
this.Controls.Add(tb);
Hoge h = new Hoge();
h.A = "aheahe";
h.B = "aheahe";
h.C = "aheahe";
h.D = new ArrayList();
//h.D = new string[3];
//h.D[0] = "sagesage";
//h.D[1] = "sagesage";
//h.D[2] = "sagesage";
h.D.Add("sagesage");
h.D.Add("sagesage");
h.D.Add("sagesage");
XmlSerializer x = new XmlSerializer(typeof(Hoge));
MemoryStream ms = new MemoryStream();
x.Serialize(ms, h);
char[] text = Encoding.GetEncoding("Shift_JIS").GetChars(ms.ToArray());
ms.Close();
tb.Text = new String(text);
}
}
public class Hoge
{
public string A { get; set; }
public string B { get; set; }
public string C { get; set; }
//public string[] D { get; set; }
public ArrayList D { get; set; }
}
}
dXNpbmcgU3lzdGVtOwp1c2luZyBTeXN0ZW0uQ29sbGVjdGlvbnM7CnVzaW5nIFN5c3RlbS5Db2xsZWN0aW9ucy5HZW5lcmljOwp1c2luZyBTeXN0ZW0uQ29tcG9uZW50TW9kZWw7CnVzaW5nIFN5c3RlbS5EYXRhOwp1c2luZyBTeXN0ZW0uRHJhd2luZzsKdXNpbmcgU3lzdGVtLkxpbnE7CnVzaW5nIFN5c3RlbS5UZXh0Owp1c2luZyBTeXN0ZW0uV2luZG93cy5Gb3JtczsKdXNpbmcgU3lzdGVtLklPOwp1c2luZyBTeXN0ZW0uWG1sLlNlcmlhbGl6YXRpb247CgpuYW1lc3BhY2UgV2luZG93c0Zvcm1zQXBwbGljYXRpb24xCnsKICAgIHB1YmxpYyBwYXJ0aWFsIGNsYXNzIEZvcm0xIDogRm9ybQogICAgewogICAgICAgIHB1YmxpYyBGb3JtMSgpCiAgICAgICAgewogICAgICAgICAgICBJbml0aWFsaXplQ29tcG9uZW50KCk7CiAgICAgICAgfQoKICAgICAgICBwcml2YXRlIHZvaWQgRm9ybTFfTG9hZChvYmplY3Qgc2VuZGVyLCBFdmVudEFyZ3MgZSkKICAgICAgICB7CiAgICAgICAgICAgIFRleHRCb3ggdGIgPSBuZXcgVGV4dEJveCgpOwogICAgICAgICAgICB0Yi5NdWx0aWxpbmUgPSB0cnVlOwogICAgICAgICAgICB0Yi5Eb2NrID0gRG9ja1N0eWxlLkZpbGw7CiAgICAgICAgICAgIHRoaXMuQ29udHJvbHMuQWRkKHRiKTsKCiAgICAgICAgICAgIEhvZ2UgaCA9IG5ldyBIb2dlKCk7CiAgICAgICAgICAgIGguQSA9ICJhaGVhaGUiOwogICAgICAgICAgICBoLkIgPSAiYWhlYWhlIjsKICAgICAgICAgICAgaC5DID0gImFoZWFoZSI7CiAgICAgICAgICAgIGguRCA9IG5ldyBBcnJheUxpc3QoKTsKICAgICAgICAgICAgLy9oLkQgPSBuZXcgc3RyaW5nWzNdOwogICAgICAgICAgICAvL2guRFswXSA9ICJzYWdlc2FnZSI7CiAgICAgICAgICAgIC8vaC5EWzFdID0gInNhZ2VzYWdlIjsKICAgICAgICAgICAgLy9oLkRbMl0gPSAic2FnZXNhZ2UiOwogICAgICAgICAgICBoLkQuQWRkKCJzYWdlc2FnZSIpOwogICAgICAgICAgICBoLkQuQWRkKCJzYWdlc2FnZSIpOwogICAgICAgICAgICBoLkQuQWRkKCJzYWdlc2FnZSIpOwogICAgICAgICAgICBYbWxTZXJpYWxpemVyIHggPSBuZXcgWG1sU2VyaWFsaXplcih0eXBlb2YoSG9nZSkpOwogICAgICAgICAgICBNZW1vcnlTdHJlYW0gbXMgPSBuZXcgTWVtb3J5U3RyZWFtKCk7CiAgICAgICAgICAgIHguU2VyaWFsaXplKG1zLCBoKTsKICAgICAgICAgICAgY2hhcltdIHRleHQgPSBFbmNvZGluZy5HZXRFbmNvZGluZygiU2hpZnRfSklTIikuR2V0Q2hhcnMobXMuVG9BcnJheSgpKTsKICAgICAgICAgICAgbXMuQ2xvc2UoKTsKICAgICAgICAgICAgdGIuVGV4dCA9IG5ldyBTdHJpbmcodGV4dCk7CiAgICAgICAgfQogICAgfQogICAgcHVibGljIGNsYXNzIEhvZ2UKICAgIHsKICAgICAgICBwdWJsaWMgc3RyaW5nIEEgeyBnZXQ7IHNldDsgfQogICAgICAgIHB1YmxpYyBzdHJpbmcgQiB7IGdldDsgc2V0OyB9CiAgICAgICAgcHVibGljIHN0cmluZyBDIHsgZ2V0OyBzZXQ7IH0KICAgICAgICAvL3B1YmxpYyBzdHJpbmdbXSBEIHsgZ2V0OyBzZXQ7IH0KICAgICAgICBwdWJsaWMgQXJyYXlMaXN0IEQgeyBnZXQ7IHNldDsgfQogICAgfQp9Cg==