获取Firefox的网址是什么? [英] Get Firefox URL?

查看:343
本文介绍了获取Firefox的网址是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我怎样才能从Firefox的使用.NET 2.0的窗口/控制台应用程序的运行实例的网址是什么? C#或VB codeS就可以了。

How can I get the url from a running instance of firefox using .NET 2.0 windows/console app? C# or VB codes will do.

谢谢!

推荐答案

建立在罗伯肯尼迪的答案,并使用 NDDE

Building on Rob Kennedy's answer and using NDde

using NDde.Client;

class Test
{
        public static string GetFirefoxURL()
        {
            DdeClient dde = new DdeClient("Firefox", "WWW_GetWindowInfo");
            dde.Connect();
            string url = dde.Request("URL", int.MaxValue);
            dde.Disconnect();
            return url;
        }
}

注意:这是很慢的。这需要几秒钟,我的电脑上。其结果将是这个样子:

NB: This is very slow. It takes a few seconds on my computer. The result will look something like this :

"http://stackoverflow.com/questions/430614/get-firefox-url","Get Firefox URL? - Stack Overflow",""

在浏览器DDE href="http://support.microsoft.com/kb/160957">更多信息。

More info on browser DDE here.

这篇关于获取Firefox的网址是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆