简体   繁体   English

iOS应用程序和.NET应用程序之间的通信?

[英]Communication between iOS Application and .NET Application?

I have 2 applications, one is iOS app and one is .NET app. 我有2个应用程序,一个是iOS应用程序,一个是.NET应用程序。 I want my iOS app send an message (call a method of .NET app, send some string to .NET app to save to database). 我希望我的iOS应用发送一条消息(调用.NET应用的方法,向.NET应用发送一些字符串以保存到数据库)。 So, how can my iOS app can communicate with .NET app? 那么,我的iOS应用如何与.NET应用通信?

If you're looking to communicate with a desktop application on a local network, Bonjour discovery (also called ZeroConf) may be the way to go. 如果您要与本地网络上的桌面应用程序进行通信,则Bonjour发现(也称为ZeroConf)可能是您的最佳选择。 Apple makes the Bonjour SDK for Windows freely available , so it appears to be reasonably easy to integrate with your desktop .NET application. Apple 免费提供 Windows的Bonjour SDK,因此与桌面.NET应用程序集成似乎相当容易。 Bonjour is already present as part of the networking services in the iPhone SDK. Bonjour已经作为iPhone SDK中的网络服务的一部分存在。

Using Bonjour, you can transparently detect the presence of an iPhone running your application on the local network from your desktop client (and vice versa), making the process of connecting the two trivial. 使用Bonjour,您可以从桌面客户端透明地检测在本地网络上运行应用程序的iPhone(反之亦然),从而使连接这两个过程变得微不足道。 Once networked, you can send whatever data you want between the two. 建立网络后,您可以在两者之间发送所需的任何数据。 I show an example of this in action in the video for the networking portion of my advanced iPhone development course on iTunes U . 在iTunes U上的高级iPhone开发课程的网络部分的视频中演示了此操作的示例。

Create web services for whatever messages you need sent to your .net app. 为需要发送到.net应用程序的任何消息创建Web服务。 Then look at NSURLConnection to figure out how you can make those 2 communicate. 然后查看NSURLConnection以弄清楚如何使这两个通信。

I agree with domino (and I voted his response as an answer). 我同意多米诺骨牌(我投票赞成他的回答)。 .NET web services would be the way to make this work. .NET Web服务将是完成此工作的方式。 Web Services were created with the intent of allowing applications on different architecture and technology to communicate together. 创建Web服务的目的是允许不同体系结构和技术上的应用程序一起通信。 If you are looking to build an iPhone app that reports usage or saves user data "in the cloud", you would need to have the iPhone app call a .NET web service. 如果要构建一个报告使用情况或“将用户数据保存在云中”的iPhone应用程序,则需要让iPhone应用程序调用.NET Web服务。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 .Net桌面应用程序和ASP.NET Web应用程序之间的通信 - Communication between .Net Desktop Application and ASP.NET Web application .Net桌面应用程序和浏览器中的Silverlight应用程序之间的通信 - Communication between a .Net desktop application and a Silverlight application in browser Java和.NET应用程序通信 - Java and .NET application communication ASP.NET页面与Silverlight应用程序之间的通信 - communication between asp.net page with silverlight application 桌面应用程序与服务器之间的套接字通信 - Socket communication between desktop application and server 使用WCF的两个winform应用程序之间的通信? - Communication between two winform application using WCF? 如何在 .NET 中进行应用程序内通信 - How to do intra-application communication in .NET 是否可以在WCF服务和.net 2.0 Windows应用程序之间进行双工通信? 如果是这样,怎么样? - Is it possible to have duplex communication between a WCF service and a .net 2.0 windows application? If so, how? 如何在Linux上运行的python脚本与Windows上运行的.NET C#应用程序之间建立通信? - How to establish communication between a python script running on Linux with a .NET C# application running on windows? Web应用程序与桌面应用程序之间的双向通信 - Two-way communication between web application and desktop application
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM