How can I request the user to open Desktop Application in React? - c#

I couldn't find the exact answer I was looking for. I have two applications - web application built with react and desktop application built in C# Forms. What I want is if the user goes to a certain page in the Web Application, the browser should open (with or without a request) the windows application and send data, like the user's id. Could you guys give me an advice how this can be done?

For that, when installing your windows C# form in the user machine, you need to register a custom protocol in the registery.
See How do I register a custom URL protocol in Windows?

Related

Open iOS application from email link

My ios application has using a custom url scheme. I want to open application from link in email. But, i want to send one link for all platforms (desktop/mobile). If user clicks the link from his ios device, i want to detect it and open my application. If application is not installed in ios device, again i want to detect it and redirect the user to app store. But, i also want to open my desktop site when the user clicks the link from desktop.
I need some methodology to detect whether the user installs he application in my server side (which is coded in .net/c# framework), then i need to take some actions.
Thanks in advance.
Prepare and share link with http scheme to your server and use user agent to detect platform (PC/iOS) server side. Then follow the answer https://stackoverflow.com/a/1109200/2714032

How can I call a win app on client machine from my aspx web page?

I want to call a windows application on my clients machine from my aspx page , and If It's possible I want to send some parameter to the application . Any guids ?
The only way you can do that is to custom-develop an ActiveX control and host that control in your page. Then the user would have to allow ActiveX controls in his browser. Normally, a browser is a sandbox, so you cannot access Windows from it... But with ActiveX, this is possible.
Here is a tutorial for developing ActiveX controls in C#: http://haseebakhtar.wordpress.com/2011/05/31/creating-an-activex-control-in-net-using-c/
Of course you can still use the old way, that is VB6 or C++...
You may use Shell API in javascript to invoke your windows application. This works only in Internet explorer browser. You need to make sure that your browser security settings (At client) is also changed to "run activex controls"
Here is a sample.
I don't know the specific details, but this might point you in the right direction.
For instance, some IRC applications react when you click a link whose target is irc://some.host.com
Same goes for textmate application for mac:
txmt://open?«arguments»
This, however, is only possible if the target application has registered a custom URL schema in the user's machine. Furthermore, the User has to allow access to it.
You could write a ClickOnce application that you can launch from the web page.
If you make it a full-trust application, you can use it to launch the local Windows application. You can pass arguments to the ClickOnce application, which can parse them and pass them on to the local Windows application.
Alternatively, if you are the author of the local Windows application (and if it is C#/.Net) then you could make the Windows application itself a ClickOnce application.

Sharing web application session with a web service

Environment:
We are having a Website and a separate ASMX - Web Service sharing the same database (MS SQL 2008). Web Service is serving the Mobile Apps at the moment. Projects are done using c#, Asp.Net, 3.5 framework, VS 2008.
Requirement:
We need to avoid same user login into Website and Mobile App (Using the Web Service) at the same time. Basically user can log in only to a one service at a time (either web or app). Also, user should be able to log in to Mobile App as soon as web browser is closed or logged out.
If user tries to log in while already logged into the other service, code should have a way to find it for notification and restriction purposes.
I think AppFabrc address the requirement but needs Windows Server 2008 R2 which we don't have at the moment.
Hope you have better ideas??
Please note this is not the same question as this.
FYI... you don't get any notification when the browser closes. You could go based on the last activity time (basically keep track of user activity - page clicks, etc). I also don't see how appFabric is going to help. You still have the same problem.
As others have mentioned, there is no easy way to know when somebody has closed the browser. You could use javascript to detect when somebody leaves your web app but there are some issues (see the following question and answers for more information: How to capture the browser window close event?)
If you're open to other workflows, you could try this:
When the user logins to the mobile app, have the mobile app log him out from the web site.
When the user logins to the web site, have the web site log him out from the mobile app.
That way your users would login and start working right away instead of them having to log in, see an error, logout from the other app, log in again.

Log in to desktop application by Windows Live ID

I want to create a login form for my desktop application that user can use Windows Live ID for that.
I create an application in manage.dev.live.com and use Desktop Implementation section.
I use a WebBrowser control and navigate to a given address. but I don't know how to receive the token for user.
If I have made a mistake please tell me how to fix that.
As of June 2011, Windows Live ID supports OAUTH 2.0 and should enable you to do that (read more about it). WPF code example can be found at https://github.com/liveservices/LiveSDK/tree/master/Samples/CSharpDesktop.

SagePay integration from Windows Forms

I’ve been asked to integrate a windows form application with SagePay to take payments directly from the application. The SagePay documentation talks about ASP.NET so I’m not sure whether this is possible. Has anyone integrated a WinForm application with SagePay before? Is it possible?
I know some payment processors have a connection option where the payment part is hosted on a form on their server. You could try embedding a web browser control into your app to display the payment page.
Usually there is another type of connection option where you can send your information via HttpWebRequest, but I'm not sure that this would work as it requires SSL. Since you are running your app as a desktop client, I'm not sure what you would have available.
I am not sure this is possible given that sagepay needs to redirect users to Mastercard securecode or Verified by Visa, I think they would need to redirect to the bank which then redirects back to a supplied URL. I would think this needs to be within a browser environment.
You can post to urls and get back a response via .net objects and parse the results to display on a form.
You can also ask SagePay to create a Vendor account with 3d secure switched off. This allows you to take payments in house in your winforms app without the customers password however most card vendors if you bypass 3d secure will not protect you if someone calls and uses a card fraudulently.
However it can definitely be done.
You can normally post to secure servers from non secure pages so again this isn't usually an issue.

Categories