如何通过API连接2个不同的应用程序? [英] How to connect 2 different application through API ?

查看:112
本文介绍了如何通过API连接2个不同的应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我有一个应用程序,我需要使用一些API与另一个应用程序连接并从那里获取输入.我不知道如何使用API​​.
任何人都可以给我相关的链接或示例代码,以帮助我将API与我的应用程序集成.

谢谢
Karthik


i am having an application which i need to use some API to connect with another application and get input from there. i don''t know how to use the API.
can any one give me related links or sample code that helps me to integrate API with my application.

Thank you,
Karthik

推荐答案

它不一定就这么简单.

这将取决于许多因素:
1)您是否拥有两个应用程序的源代码?
2)如果不是,那么其他应用程序是否公开API以从中访问数据?
3)如果没有,你会做魔术吗?

如果您有源代码,并且始终会向应用程序A询问信息,那么我将看一下 TCPListener [ ^ ]类.

如果应用程序公开了API,那么您需要查看该应用程序-它们都是不同的,因此我不能一一列举.

如果都不是,则您需要的API称为 PnP [ ^ ]
It''s not necessarily as simple as that.

It is going to depend on a number of factors:
1) Do you have the source code to both applications?
2) If not, does the other application expose an API to access data from it?
3) If not, can you do magic?

If you have the source code, and you will always ask Application A for info, then I would look at the Socket[^] or TCPListener[^] classes.

If the Application exposes an API, then you need to look at the application - they are all different, so I can''t be specific.

If neither of these, then the API you need is called PnP[^]


尝试执行以下简单步骤:
1.将API参考添加到您的项目中.
2.了解API公开的所有功能.
3.围绕该API创建包装器,并允许您的应用程序使用该包装器.
Try doing these simple steps:
1. Add API reference to your project.
2. Understand what all functionalities that API exposes.
3. Create a wrapper around that API, and allow that wrapper to be used by your application.


这篇关于如何通过API连接2个不同的应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆