获取所有IE当前浏览的Url

using  System;
using  System.Windows.Forms;
using  SHDocVw;
namespace  WindowsApplication35
{
    
public   partial   class  Form1 : Form
    
{
        
public  Form1()
        
{
            InitializeComponent();
        }

        
private   void  Form1_Load( object  sender, EventArgs e)
        
{
            ShellWindowsClass shellWindows 
=   new  ShellWindowsClass();
            
foreach  (InternetExplorer ie  in  shellWindows)
            
{
                
string  filename  =  System.IO.Path.GetFileNameWithoutExtension(ie.FullName).ToLower();

                
if  (filename.Equals( " iexplore " ))
                
{
                    Console.WriteLine(ie.LocationURL);
                }

            }

        }


         
    }

}
 

posted on 2007-12-12 17:36  代码王子  阅读(134)  评论(0编辑  收藏  举报

导航