Click here to Skip to main content
15,884,099 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
HI Friends How are yoU?
when i m running my exe from browser it is not working properly. you just see my code
when i run exe from my cmd its perfectly show me browser and google.com open but when i run on browser by
exname:"gau"its not show correctly


first registry value

hkey_class_root
HKEY_CLASSES_ROOT
alert
(Default) = "URL:Alert Protocol"
URL Protocol = ""
DefaultIcon
(Default) = "test5.exe,1"
shell
open
command
(Default) = "d:\.net testing\test5.exe" "%1"

now see my c# code

namespace WindowsFormsApplication1
{
static class Program
{

static void Main(string[] args)
{
if (args.Count() > 0)
{

if (args[0].ToString() == "gau")
{
System.Diagnostics.Process.Start(http://www.google.com);

}

}
else
{
MessageBox.Show("exe without para"");
}
Console.ReadLine();

}
}
}

now when i run exe from my cmd its perfectly show me browser and google.com open but when i run on browser by
exname:"gau" its not show correctly
Posted

1 solution

Just compare your registry entry with the entry for e.g. http.
And voilà: your entry is called alert, and that's to be used in the URL:
alert:gau
Well, for better diagnostics, you ought to change the Messagebox's text when the expected parameter is not found - display the number of parameters and their values!
You'll see then that the protocol part is included in the parameter - you have to remove that first.
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900