fork 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>\n\t<head>\n\t</head>\n" +
  46. "\t<body>\n\t\t<basefont face='MS Pゴシック'>\n\t\t<dl>\n" +
  47. "\t\t</dl>\n\t</body>\n</html>\n";
  48. }
  49.  
  50. void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
  51. {
  52. HtmlDocument doc = webBrowser1.Document;
  53. HtmlElement elemdt = doc.CreateElement("dt");
  54. elemdt.InnerHtml = "hogehoge1";
  55. doc.Body.FirstChild.FirstChild.AppendChild(elemdt);
  56.  
  57. //ddタグ(2chの場合レス本文)
  58. HtmlElement elemdd = doc.CreateElement("dd");
  59. elemdd.InnerHtml = "ageage1";
  60. doc.Body.FirstChild.FirstChild.AppendChild(elemdd);
  61.  
  62. textBox1.Text = webBrowser1.DocumentText;
  63. }
  64. }
  65. }
  66.  
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty