欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  后端开发

C# 操作外部Internet Explorer浏览器

程序员文章站 2024-04-04 14:19:11
...
private void Form1_Load(object sender, EventArgs e)  
{  
    object ppvComObject = null;  
    try 
    {  
        Guid CLSID_ShellWindows = new Guid("9BA05972-F6A8-11CF-A442-00A0C90A8F39");  
   
        Type pComType = Type.GetTypeFromCLSID(CLSID_ShellWindows, true);  
        ppvComObject = Activator.CreateInstance(pComType);  
   
        int webCount;  
        if ((webCount = (int)pComType.InvokeMember("Count", BindingFlags.GetProperty, null, ppvComObject, null)) > 0)  
        {  
            for (int i = 0; i