0

代码如何使用InternetExplorer来自SHDocVw. 在 C# 中???

非常感谢您

我的代码:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using System.Windows.Forms;
using SHDocVw;
using mshtml;

namespace TTD_2
{
    class Program
    {
        static void Main(string[] args)
        {

            InternetExplorer webBrowser1 = new InternetExplorer();

            webBrowser1.Visible = true;

            object mVal = System.Reflection.Missing.Value;
            webBrowser1.Navigate("https://xxxxxxx.xxx", ref mVal, ref mVal, ref mVal, ref mVal);


            // rest of the code

            // Closing the Internet Explorer Window
            //webBrowser1.Quit();
        }
    }
}
4

1 回答 1

0

我想你需要做这样的事情

        InternetExplorer webBrowser1 = new InternetExplorer();
        webBrowser1.DocumentComplete += (object disp, ref object url) =>
        {
            //your code
        };

https://msdn.microsoft.com/en-us/library/aa768329(v=vs.85).aspx

于 2017-09-18T02:49:40.607 回答