---
title: "获取所有ＩＥ当前浏览的Ｕｒｌ"
author: "csstome"
date: "2007-12-12T17:36:00Z"
tags: []
slug: "untitled"
draft: false
lastmod: "2007-12-12T17:36:00Z"
id: 1033165
url: "https://csstome.iteye.com/blog/1033165"
---

![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)using System;  
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif) using System.Windows.Forms;  
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif) using SHDocVw;  
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif) namespace WindowsApplication35  
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif) ... {  
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif) public partial class Form1:Form  
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif) ... {  
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif) public Form1()  
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif) ... {  
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif) InitializeComponent();  
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif) }  
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif) private void Form1\_Load( object sender,EventArgse)  
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif) ... {  
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif) ShellWindowsClassshellWindows = new ShellWindowsClass();  
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif) foreach (InternetExplorerie in shellWindows)  
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif) ... {  
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif) string filename = System.IO.Path.GetFileNameWithoutExtension(ie.FullName).ToLower();  
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)  
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif) if (filename.Equals( " iexplore " ))  
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif) ... {  
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif) Console.WriteLine(ie.LocationURL);  
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif) }  
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif) }  
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif) }  
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)  
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)  
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif) }  
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif) }