fork download
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using System.ComponentModel;
  5. using System.Data;
  6. using System.Drawing;
  7. using System.Linq;
  8. using System.Text;
  9. using System.Windows.Forms;
  10. using System.IO;
  11. using System.Xml.Serialization;
  12.  
  13. namespace WindowsFormsApplication1
  14. {
  15. public partial class Form1 : Form
  16. {
  17. public Form1()
  18. {
  19. InitializeComponent();
  20. }
  21.  
  22. private void Form1_Load(object sender, EventArgs e)
  23. {
  24. TextBox tb = new TextBox();
  25. tb.Multiline = true;
  26. tb.Dock = DockStyle.Fill;
  27. this.Controls.Add(tb);
  28.  
  29. Hoge h = new Hoge();
  30. h.A = "aheahe";
  31. h.B = "aheahe";
  32. h.C = "aheahe";
  33. h.D = new ArrayList();
  34. //h.D = new string[3];
  35. //h.D[0] = "sagesage";
  36. //h.D[1] = "sagesage";
  37. //h.D[2] = "sagesage";
  38. h.D.Add("sagesage");
  39. h.D.Add("sagesage");
  40. h.D.Add("sagesage");
  41. XmlSerializer x = new XmlSerializer(typeof(Hoge));
  42. MemoryStream ms = new MemoryStream();
  43. x.Serialize(ms, h);
  44. char[] text = Encoding.GetEncoding("Shift_JIS").GetChars(ms.ToArray());
  45. ms.Close();
  46. tb.Text = new String(text);
  47. }
  48. }
  49. public class Hoge
  50. {
  51. public string A { get; set; }
  52. public string B { get; set; }
  53. public string C { get; set; }
  54. //public string[] D { get; set; }
  55. public ArrayList D { get; set; }
  56. }
  57. }
  58.  
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty