how can i open C# WPF desktop application when user hit specific formated url on browser ?
Thank you.
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
Microsoft has ClickOnce deployment technology.
You may read about it here https://learn.microsoft.com/en-us/visualstudio/deployment/clickonce-security-and-deployment
There is no other normal solution. (for WPF DESKTOP application)
In case when you control pc of user - you may write and install activeX component to his pc to run application by link. But better to use ClickOnce - it will install app to user or call it, if it is installed already.