我的网络浏览器应用程序如何从另一个应用程序获取打开的 URL
我通过 Visual Studio.Net 2008 创建了一个“Windows 窗体应用程序”项目。
为了将我的应用程序设置为操作系统的默认 Web 浏览器,我修改注册表如下:
[HKEY_CLASSES_ROOT\HTTP\shell\open\command] @="\"F:\My Browser\bin\Debug\My Browser.exe\" -nohome"
然后我单击“Live Messenger”窗口中的链接进行测试。
http://2.bp.blogspot.com/_lktgSLsaLgU/R3di1ZNDyWI/AAAAAAAACWQ/u1xcH9W0g_I/s400/vicito-news.png
结果,它将打开我的应用程序。问题是,我找不到我在属于“Program”类的“Main”方法的“args”参数中单击的URL。
public static class Program
{
[STAThread]
static void Main(string[] args)
{
}
}
我在哪里可以找到网址?或者怎样才能找到网址?
I have created a "Windows Forms Application" project by Visual Studio.Net 2008.
In order to set my appliction as the default web browser for my operating system, I modify registry as below:
[HKEY_CLASSES_ROOT\HTTP\shell\open\command]
@="\"F:\My Browser\bin\Debug\My Browser.exe\" -nohome"
and then i click a link in a "Live Messenger" window to test.
http://2.bp.blogspot.com/_lktgSLsaLgU/R3di1ZNDyWI/AAAAAAAACWQ/u1xcH9W0g_I/s400/vicito-news.png
As a result, it will open my application. the problem is that, I can't find out the URL I clicked in the "args" argument of the "Main" method belong to the "Program" class.
public static class Program
{
[STAThread]
static void Main(string[] args)
{
}
}
Where I can find out the URL? Or how can I find out the URL?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的注册表项应包含 %1 指令,该指令指示 shell 将 URL 参数传递到浏览器参数中。
因此,在您的情况下,正确的注册表是:
Your registry key should include the %1 directive that instructs the shell to pass the URL parameter into the browsers arguments.
So in your case the correct registry is: