fork(1) download
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9.  
  10. namespace WindowsFormsApplication1
  11. {
  12. public partial class Form1 : Form
  13. {
  14. public Form1()
  15. {
  16. InitializeComponent();
  17. this.Load += new EventHandler(Form1_Load);
  18. this.Shown += new EventHandler(Form1_Shown);
  19. }
  20. WebBrowser webBrowser1 = new WebBrowser();
  21. TabControl tabControl1 = new TabControl();
  22. TextBox textBox1 = new TextBox();
  23. TabPage tabPage1 = new TabPage();
  24. TabPage tabPage2 = new TabPage();
  25. void Form1_Load(object sender, EventArgs e)
  26. {
  27. webBrowser1.Dock = DockStyle.Fill;
  28. textBox1.Multiline = true;
  29. textBox1.Dock = DockStyle.Fill;
  30.  
  31. tabPage1.Text = "Web";
  32. tabPage1.Controls.Add(webBrowser1);
  33. tabPage2.Text = "Text";
  34. tabPage2.Controls.Add(textBox1);
  35. tabControl1.TabPages.Add(tabPage1);
  36. tabControl1.TabPages.Add(tabPage2);
  37. tabControl1.Dock = DockStyle.Fill;
  38. this.Controls.Add(tabControl1);
  39. }
  40.  
  41. void Form1_Shown(object sender, EventArgs e)
  42. {
  43. webBrowser1.DocumentCompleted += new WebBrowserDocumentCompletedEventHandler(webBrowser1_DocumentCompleted);
  44. webBrowser1.DocumentText =
  45. "<html>" + Environment.NewLine +
  46. "\t<head>" + Environment.NewLine +
  47. //"\t\t<meta http-equiv=\"Content-Type\" content=\"text/html; charset=shift-jis\">" + Environment.NewLine +
  48. "\t</head>" + Environment.NewLine +
  49. "\t<body>" + Environment.NewLine +
  50. "\t\t<basefont face='MS Pゴシック'>" + Environment.NewLine +
  51. "\t\t<dl>" + Environment.NewLine +
  52. "\t\t</dl>" + Environment.NewLine +
  53. "\t</body>" + Environment.NewLine +
  54. "</html>" + Environment.NewLine;
  55. }
  56.  
  57. void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
  58. {
  59. HtmlDocument doc = webBrowser1.Document;
  60. HtmlElement elemdt = doc.CreateElement("dt");
  61. elemdt.InnerHtml = "hogehoge1";
  62. doc.Body.FirstChild.FirstChild.AppendChild(elemdt);
  63.  
  64. //ddタグ(2chの場合レス本文)
  65. HtmlElement elemdd = doc.CreateElement("dd");
  66. elemdd.InnerHtml = "ageage1";
  67. doc.Body.FirstChild.FirstChild.AppendChild(elemdd);
  68.  
  69. textBox1.Text = webBrowser1.DocumentText;
  70. }
  71. }
  72. }
  73.  
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty