在Windows应用程序中链接Api [英] Linking Api in windows application

查看:83
本文介绍了在Windows应用程序中链接Api的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨 我可以在Windows应用程序中链接api吗...
假设我需要计算任何国家的货币,为此,我想使用一个在线提供的内置货币计算器....

解决方案

这个问题也有点一般的;然后您会广泛使用"API"一词.这取决于您要使用的服务.它可以是一个Web服务.在这种情况下,您将使用服务器所有者发布的界面,或者您可能拥有WSDL文件,使用WSDL.EXE生成C#或VB.NET代理代码,并将获得的源代码包含在您的项目中.

在其他情况下,您可能需要按照通常称为" Web抓取"的样式,在URL中发送请求并分析收到的HTML或其他内容,以获取所需的数据. ".基本上,您将需要使用HttpWebRequest/HttpWebResponse.

请查看我的解决方案和讨论:
如何从另一个站点获取数据 [ ^ ],
从网页中获取特定数据 [ 解决方案

The question is a bit too general; and you treat the term "API" to widely. It depends on the service you want to use. It could be a Web Service; in this case, you would use the interface published by the owner of the server or you may have WSDL file, produce C# or VB.NET proxy code using WSDL.EXE and include obtained source code in your project.

In other cases, you may need to send your request in the URL and analyze the HTML or other content you receive in response to get the data you need, in the style of what is usually called "Web scraping". Basically, you will need to use HttpWebRequest/HttpWebResponse.

Please see my solution and discussions:
How to get the data from another site[^],
get specific data from web page[^].

—SA


这篇关于在Windows应用程序中链接Api的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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