现在的位置: 首页 > 综合 > 正文

显示IE正在浏览的网页地址

2013年12月12日 ⁄ 综合 ⁄ 共 436字 ⁄ 字号 评论关闭
在网上找到的相关资料如下:
添加对Microsoft Internet Controls 1.1的引用,
主要代码如下:
SHDocVw.ShellWindows test=new SHDocVw.ShellWindowsClass();
for(int i=0; i<test.Count; i++)
 {
 SHDocVw.InternetExplorer ie = null;
 ie=test.Item(i) as SHDocVw.InternetExplorer;
 Console.WriteLine(ie.LocationURL );
 }
 
如遇到框架的IE时,无法直接从地址栏中看到网页地址,此招有效,但仅对IE有效,对Firefox无效。
如想看电影、禁止广告等,可以据此地址寻找或关闭该窗体。
如想查看网页源代码,可以在IE浏览器的地址栏中输入:
 view-source:+地址,即可查看。
例子: view-source:http//community.csdn.net/Expert/Forum.asp

抱歉!评论已关闭.