如何从 Visual C 发送数据应用程序到iPhone应用程序?

发布于 2024-12-19 14:13:42 字数 386 浏览 3 评论 0 原文

这个问题一定是非常基本的,但如果您有任何指示,我将非常感谢任何帮助!

我有一个 Visual C++ 中的 Windows 开发项目,并且想通过 Internet 将二进制数据(主要是图像,但也有其他内容)发送到 iPhone 应用程序。

您知道如何执行此操作的最简单方法是什么?我是否应该在 iPhone 上使用 HTTP 和 NSUrlConnection 以及一些框架库(哪个?)在我的 Visual C++ 应用程序中设置 Web 服务器?或者我是否需要设置一个像 Apache 这样的适当的 Web 服务器(然后我如何让我的 C++ 应用程序与它通信??)

所以你看我对 Web 技术完全一无所知......如果你认为没有帮助我我也很感谢书籍推荐:)

非常感谢,干杯

This question must be really basic, but if you have any pointers I would really appreciate any help!

I have a Windows development project in Visual C++, and would like to send binary data (images mostly, but also other stuff) to an iPhone app over the Internet.

What is the simplest way you know how to do this? Should I use HTTP and NSUrlConnection on the iPhone, and some framework library (which?) to set up a web server inside my Visual C++ application? Or do I need to setup a proper web server like Apache (and how do I have my C++ application communicate with it then??)

So you see I am totally clueless about web technologies... if you think there is no helping me I'd appreciate book recommendations as well :)

Thanks a lot and cheers

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

秋心╮凉 2024-12-26 14:13:42

另一个想法是使用一些云存储服务,例如 DropBox。该服务允许您保存文件并使用 HTTP 访问它们。如果您只需要 2GB,DropBox 也是免费的。

他们有用于为多个平台上传/下载文件的 API: http://www.dropbox.com /developers/reference/sdk

不幸的是,他们没有 C++ API。但由于 DropBox 仅基于 HTTP,因此您应该能够使用 libcurl 或任何其他 HTTP 库来实现此目的。这家伙遇到了一些困难 使用 libcurl 将文件上传到 DropBox (虽然没有答案,但应该不会太难克服)

Another idea can be to use some cloud storage service like DropBox. This service allows you to save files and access them using HTTP. DropBox is also free if you only need 2GB.

They have API for uploading/downloading files for several platforms here: http://www.dropbox.com/developers/reference/sdk

Unfortunately, they do not have an API in C++. But since DropBox is just based on HTTP, you should be able to use libcurl or any other HTTP library for this. This guy ran into some difficulties Using libcurl to upload files to DropBox (without answer though, but shouldn't be too hard to overcome)

酷到爆炸 2024-12-26 14:13:42

不确定 C++ 应用程序中的 Web 服务器是最好的主意。我会在 php/java/choose 你的毒药中实现一个简单的外部网络服务器。我会将网络服务器放在我要购买的域上的某些托管服务中。然后当然使用HTTP来管理两者之间的通信。 C++ 应用程序将通过 HTTP 将图像上传到 Web 服务器,而 iPhone 应用程序将通过 HTTP 下载它们。

另外,如果您不想购买托管服务/域名,请查看 Google AppEngine 等服务,只要您不过度使用它,它是免费的。

检查此问题以从 C++ 发出 HTTP 请求: How do you make使用 C++ 的 HTTP 请求?

Not sure a web server in your C++ application is the best idea. I would implement a simple external web server in php/java/choose your poison. I would put the web server in some hosting service on a domain I would purchase. And then of course use HTTP to manage the communication between the two. The C++ application would upload images via HTTP to the web server, and the iphone app would download them via HTTP.

Also, if you don't want to purchase a hosting service / domain, take a look at services like Google AppEngine which is free as long as you don't overuse it.

Check this question for making HTTP requests from C++: How do you make a HTTP request with C++?

情深如许 2024-12-26 14:13:42

这应该可以帮助您开始使用 mysql 数据库编写 PHP Web 服务,并让 iOS 应用程序访问它:http://www.raywenderlich.com/2941/how-to-write-a-simple-phpmysql-web-service-for-an-ios-app

这大约是一半有趣,另一半基本上是用 c++ 做同样的事情(用 libcurl 或类似的东西)

This should get you started on writing a PHP web service with a mysql DB and having an iOS app accessing it: http://www.raywenderlich.com/2941/how-to-write-a-simple-phpmysql-web-service-for-an-ios-app

this is about half the fun, the other half is basically doing the same thing with c++ (with libcurl or something similar)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文