How to open or launch my desktop application(windows application) developed using C# in browser

Dineshkumar.S 446 Reputation points
2023-01-23T06:11:55.94+00:00

I have to launch or open my desktop application developed using C# in the browser? please give me some suggestions on how to achieve it ? Thanks in advance.

Explanation:

I have a windows app XYZ.exe so I need to open this application from the browser. so when the user clicks the link in the browser it should open my windows application so how to achieve this ?? Kindly give me your ideas.

Windows Forms
Windows Forms
A set of .NET Framework managed libraries for developing graphical user interfaces.
1,828 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,245 questions
{count} vote

4 answers

Sort by: Most helpful
  1. Reza Aghaei 4,936 Reputation points MVP
    2023-01-23T08:34:29.22+00:00

    You need to register your application to a URL scheme, like what skype: , msteams: , mailto: and other url schemes do to open a client application using a link, then assuming you have registered a myapp: url scheme for your application, then a link like <a href="myapp:?param1=something&param2=somethingelse">Open my app!</a> will open your application and even pass some parameters to the app.

    I've already posted a detailed answer in this SO post:

    You can download the sample code of the answer, or clone the repository. The project even contains an installer, which install the application and registers the URL scheme.

    Also make sure you install the You can download the code from the repository, but before that make sure you install the Microsoft Visual Studio Installer Projects 2022 extension or Microsoft Visual Studio Installer Projects 2019 - 2017 depending to your visual studio version.

    If you want to see how to parse query string, take a look at the follow up question here: How to parse query string parameters when I open my app using a custom URL scheme?

    Also to learn more, you can take a look at:

    1 person found this answer helpful.

  2. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  3. Bruce (SqlWork.com) 55,686 Reputation points
    2023-01-24T18:53:12.3833333+00:00

    the only way to pass information from the link to the app is via the query string values in the url (as described above). if the page rendering the link, is authenticated, it can add user identification to the url. generally the password would not be available and rendering it on the page would be a security risk.

    typically you would render an access token, and the app would call the webserver to verify the token.

    0 comments No comments

  4. aluzi liu 486 Reputation points
    2023-10-08T03:41:55.2066667+00:00

    The URL scheme solution only work for un-packaged app, if app is WinUI packaged type, URL scheme can not launch it.

    So, how to launch packaged app from browser?

    0 comments No comments