How do I kick off an executable from a web page? - c#

We have rewritten a WinForms app A as a web app. The old WinForms app had integration with WinForms app B, in that you could fire it up from app A with a set of variables.
Users are now demanding the same functionality from a rewritten web app. My first thought was for WinForms app B to create my own URL protocol (foo://...), but it seems that to do that you have to create keys in HKEY_CLASSES_ROOT - which is an activity done by an admin user. However, the users are basically limited users and WinForms app B is actually a ClickOnce app.
What are my options?

Since App A is now in the cloud and the user interacts with it via the browser, it is sandboxed and many of the things that a desktop app can do are not available to it anymore.
This is a security feature and outside of writing a browser plugin that will bridge between App a on the browser and App b, there isn't much you can do.

Related

Manage who connects to a ClickOnce Application

I've published a WPF application with ClickOnce with internet connection required.
Is there any way to control who can connect to the application?
Let's say the app needs a subscription system to be used, and if the client doesn't pay, the application can't start.
Administering ClickOnce Deployments
Even though there are no built-in mechanisms with ClickOnce to determine which users are trying to deploy your applications, there are a number of approaches you can employ to obtain this information. These include:
Windows authentication over HTTP(S).
Custom authentication designed
into the application.
Passing query string parameters when launching
the application (requires dynamic manifest generation with embedded
user credentials for installed applications).
Custom client proxy and
custom HTTP module authentication.
I ended up choosing Custom Authentification methods to control who can enter or not into my application.

ASP.Net - Use C# and VB in the same Web App

I have come into a new company to upgrade a large web application. Yes it is a Web app not a Web site and I am using Web forms.
It is quite old and I would say poorly written. The PM wants to have it cleaned up and ported to C#. The issue here is that it is constantly changing and updates will still be working whilst I work on it.
The current plan is to create a new home page launcher in a new UI (c#) so that the upgrade is coming. Rewrite certain sections at a time and release as we go. The launcher currently actually launches new pages in a new browser window so I do think this is feasible.
However, so my question is can this be done. I've read a number of threads that it is possible with web sites but not with web apps. If this cant be done is there a solution where I can run my web app and launch windows in the older app. Desirably having the two different web apps in the same solution?

OneDrive shared appFolder

I'm using the c# UWP OneDrive Api and have two questions:
Is the exchange (sending and receiving) of files + login via this API always encrypted?
Is it possible to share the Special Folder App Root with two Apps? Like I have an App A, which is free and an App A pro, which costs something and I want to make it very easy for the user to use his/her data from App A in App A pro without him/her having to change anything, but just login to OneDrive and the App fetches the necessary data from App A free version.
All connections to the OneDrive API are via https encrypted channels.
The App aspect is build around the application id that you use to communicate with the OneDrive service, you could have two separate applications on a Android/iOS app stores one free and one paid that use the same underlying application id.

Run windows form app from asp.net page

I want to run a Windows form app from ASP.net page when clicked on a ASP button. Now I don't want to show the app on ASP.net page, as I said earlier, I want to start it.
I'm calling the Windows form app directly behind a button but it is not working and giving errors. when I searched for it, I saw that we cannot call/run windows form app from ASP.net page. So any one who can give a better idea to achieve this task?
How about Client/server technique? So that when I pass a message from client (ASP.net page) to server (Win Form App), the app should run.
Please help!
If you want to launch the WinForms app from a web page, the best approach is probably to use ClickOnce technology. It allows you to publish your application directly through a web page (no separate installer needed).
ClickOnce is a deployment technology that enables you to create self-updating Windows-based applications that can be installed and run with minimal user interaction. Visual Studio provides full support for publishing and updating applications deployed with ClickOnce technology if you have developed your projects with Visual Basic and Visual C#.
http://msdn.microsoft.com/en-us/library/t71a733d(v=vs.110).aspx
ClickOnce also works with C++ apps, but there are some additional steps
http://msdn.microsoft.com/en-us/library/ms235287.aspx
There's an excellent answer on Stack Overflow that reviews some things to be aware of. Suggest you read through that as well
https://stackoverflow.com/a/2365481/141172
If you want to launch your application (possibly including parameters) from a web page, one approach is to have the application register a protocol handler. A protocol handler allows an application to react to a URL with a new protocol that you define, e.g. myappname://TheFileToOpen
http://msdn.microsoft.com/en-us/library/aa767914(v=vs.85).aspx

Control website via desktop application

Is it possible for a desktop application to communicate with a javascript API that will affect the user's browser? For example, I would like to call a JS API of a web service even if the browser is not in focus. The user can select various functions from within the desktop application and it will take effect in the browser. thanks
You probably want to consider automating the browser from your application. As you are using .NET, WatiN is a good option to do that:
WatiN
To get something like that to work you would need to have your web app call for updates on a regular interval and then make the appropriate changes.
Your desktop app can make requests to whatever web interface you wish to access data. It really depends on how you build it out.
Is this an existing app? Are you building something new? More info would be nice to have to get more specific.

Categories