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. }
  18.  
  19. private void Form1_Load(object sender, EventArgs e)
  20. {
  21. webBrowser1.Navigating += new WebBrowserNavigatingEventHandler(webBrowser1_Navigating);
  22. webBrowser1.DocumentCompleted += new WebBrowserDocumentCompletedEventHandler(webBrowser1_DocumentCompleted);
  23. }
  24. int xxcount = 0;
  25. void webBrowser1_Navigating(object sender, WebBrowserNavigatingEventArgs e)
  26. {
  27. System.Threading.Interlocked.Increment(ref xxcount);
  28. }
  29.  
  30. void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
  31. {
  32. System.Threading.Interlocked.Decrement(ref xxcount);
  33. if (xxcount == 0)
  34. {
  35. SHDocVw.IWebBrowser2 axweb = (SHDocVw.IWebBrowser2)webBrowser1.ActiveXInstance;
  36. //もっと細かい制御をここで
  37. }
  38. }
  39. }
  40. }
  41.  
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty