how can i open C# WPF desktop application when user hit specific formated url on browser ?
Thank you.
So at first you need to register your application to an URI-SCHEME via the windows registry.
SAMPLE REGISTRY FILE:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\your_specific_scheme_name]
"URL Protocol"=""
@="URL:your_specific_scheme_name"
[HKEY_CLASSES_ROOT\your_specific_scheme_name\shell]
[HKEY_CLASSES_ROOT\your_specific_scheme_name\shell\open]
[HKEY_CLASSES_ROOT\your_specific_scheme_name\shell\open\command]
@="\"C:\\PathToYourAppInstallFolder\\AppName.exe\" \"%1\""
Then you just need to pass the arguments within your application.
SAMPLE C#:
static void Main(string[] args)
{
// so somethings with your arguments
}
EDIT:
For proper use of startup arguments at WPF applications you can have a look here: How to start WPF based on Arguments as well
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With