如何获得IE导航地址? [英] How to get IE navigation address?
本文介绍了如何获得IE导航地址?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要C#专家的帮助:
我正在构建IE工具栏.使用.NET和Windows窗体使用带对象扩展资源管理器.
如何获取IE导航地址(URL)并写入.txt或.xml文件.
例如.我记录到IE地址栏"www.google.com",然后将文件www.google.com归档.
Hi,
I need C# experts help:
I`m building a IE Toolbar.Extending Explorer with Band Objects using .NET and Windows Forms.
How to get IE navigation address (URL) and write in to .txt or .xml file.
eg. I record to IE address bar "www.google.com" and i`m get to file www.google.com. how to get this information from IE?
推荐答案
对象ShellWindowsClass
将具有与IE窗口相关的所有信息.您可以遍历它们和当前URL.像这样:
An object ofShellWindowsClass
will have all the IE windows related information. You can loop through them and the current URL. Like this:
ShellWindowsClass windows = new ShellWindowsClass();
foreach (InternetExplorer internetWindow in windows)
{
string url = internetWindow.LocationURL;
}
当我使用
When i use
foreach (InternetExplorer ie in new ShellWindowsClass())<br />
{<br />
string url = ie.LocationURL;<br />
<br />
MessageBox.Show("Welcome to" + url, "Welcome", MessageBoxButtons.OK,<br />
MessageBoxIcon.Information);<br />
<br />
<br />
}
获取有关打开文件夹位置的信息.例如. C:/用户/...
我正在使用Internet Explorer8.也许是问题所在?
get info about open folder location. eg. C:/User/...
I am using Internet Explorer 8. Perhaps this is the problem?
它对我来说很好用.我也用过IE8.
It works well for me. I too used IE8.
这篇关于如何获得IE导航地址?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文