Adding external callable api to program C# [closed]
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this questionI'm trying to create a simple application that is only supposed to be called by other applications. I've taken the concept from linux where you often have a application that depends on another, and then it does api-calls to that other application. The example I'm thinking about is libnotify which enables for notification of messages with or without image and title (this can for instance be found in ubuntu linux > 9.04). And then somebody created a plugin for pidgin that when you receive a message call the libnotify-"program" to display the notification, instead of building it's own notification-method.
Well, this is more or less what I want to create myself, but on windows. I've created a application that displays notifications (sort of like msn does on new message), and then I want to create for instance facebook-notifications that whenever it need to notify anything it will just call my notification-program. I've thought about making the all the specific parts as plugins (like a facebook plugin, and a twitter plugin), but then I have to load the external dlls into my already running program, and I rather like that the other programs can just call on the first one.
Any he开发者_开发百科lp or thoughts on the subject would be appreciated.
This is what DLLs are meant for.
Make your notification code into a DLL with a public class that displays the notification. You can then make other programs that reference the DLL and use the class.
You can use:
- WCF
- COM
- Web Services
- Run separate Process
- Sockets
- Named Pipes
Basically any inter-process communication.
But the easiest would be to simply reference a dll.
You can make a Web Service and have it reside on a central server while all your applications have access to it.
Here is a sample web service: http://www.codeproject.com/KB/webservices/myservice.aspx
精彩评论