writing browser plug-in in c# - c#

I wrote a desktop application in c# with Visual Studio 2008 and I want it to communicate with browser following this scenario: once a user opens a bank website an event should be sent to the desktop application.The link of bank is predifined (known).In other words I want to develp a browser plugin which fires events to the application if users opens the link.
At this stage I want just for one of the browsers Mozilla or IE9.
Any idea or tutorial how to start developing such a plug-in?

Developing an IE 9 Browser Helper Object is relatively easy. Look for "Browser Helper Object". In Firefox you can't develop plug-ins in C#, it has its own extensive plug-in framework. You'll need to freshen up on your JavaScript.

Related

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

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?

C# Windows Forms Interacting With Web Browser

I have developed a Windows Form application in C# that interacts with a phone system.
I would like to add click to dial functionality to the application.
When I click on a telephone number in a web browser I would like to copy the telephone number into a string and execute some code in my Windows Form application.
I have looked into using Selenium but it seems that the user must be using an instance of Chrome that Selenium has created to complete the above task.
In the end, I used the tel: protocol used in HTML href.
I then set my program to be the default handler of tel:.

Can Chrome auto pick up a username and password from a database using C#

I am new to coding and I am currently working on a GUI for a database.
The problem I am running into is that I need to find a way to have the GUI log in to a database in chrome automatically using the username and password that they will provide to open the GUI.
Again, I am new to coding and I do not know if this is possible but I can't find a way to have chrome auto enter that information and open a link that will allow user to create a new transaction.
I am using C#.
I tried this:
System.Diagnostics.Process.Start("chrome.exe", "http://database.spinca.com/transaction/new/");
But that only gets me to the login page.
You add your code to the Web Server side. The browser (which hosts/renders the UI) communicates with the Server (which returns the UI code to the browser.) I suggest taking a quick training class on web based technologies and learn the relationship between Browser and web server. The browser cannot communicate directly with local resources (such as a database or disk). There are many blogs and books available on this subject - or use Pluralsight. Khan Academy has an intro to HTML/JS but is strictly Client side (browser) based.
I assume you are using a Microsoft based web server technology (IIS) since you are coding in C#. There are several hello-world examples, and many are in Visual Studio itself.
If you don't need a Browser (HTML) - you might consider a Windows application. In that case look into WPF apps which use XAML for UI definition. Look in Templates Visual C# WPF App in Visual Studio.

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.

Detect browser URL

Is there a way for a standard C# desktop app to detect the URL that the browser is going to navigate to, and possibly prevent it from doing that? An example would be all those download managers that pop up when I click a link in the browser and prevent browser's default action from occurring.
you can not access to internet browsers from winform projects but
you can access if you have a plug-in app. for browsers.
Develop a plug-in app. and communicate with your winform app. like internet download manager app.
here is expamle for IE add-ons
IE add-on express
for chrome
Google dev guide
hopefully helps it.

Categories