简体   繁体   English

使用AJAX和c ++ / cli与Web服务器进行交互

[英]Interacting with a web server using AJAX and c++/cli

I am writing a desktop program which I want to register on the first use through the web. 我正在编写一个桌面程序,想要在第一次使用时通过网络进行注册。 on the registration it should get a message from the website of ok or not-ok. 在注册时,应该会从正常或不正常的网站上收到一条消息。

I think that this interaction is very similar to AJAX, but my porgram is written in c++/cli. 我认为这种交互与AJAX非常相似,但是我的代码是用c ++ / cli编写的。

What is the best way to interact with my website (server)? 与我的网站(服务器)进行交互的最佳方式是什么?

I saw there are libraries for c++ and AJAX. 我看到有用于c ++和AJAX的库。

Mainly I saw wt and AJAX.NET. 我主要看到wt和AJAX.NET。

Would AJAX.NET work with c++/cli? AJAX.NET是否可以与c ++ / cli一起使用?

is wt a good library for AJAX considering I have only one call to the server, isn't it an "overkill". 考虑到我只有一个服务器调用,对于AJAX来说是一个很好的库,这不是“过度杀伤力”。

What is the simplest way to send a simple ajax request to my website (server)? 将简单的ajax请求发送到我的网站(服务器)的最简单方法是什么? Do I need a library at all? 我是否需要图书馆?

I'd go with Wt .. their hello world app is a good place to start: 我会选择Wt ..他们的hello world应用是一个不错的起点:

I reckon have a play with that, and see how you feel about integrating it with your app. 我认为这很有趣,并了解您如何将其与您的应用程序集成。

Maybe you just want your application to do some HTTP requests (to a distant web server), so you need an HTTP client library usable from C++. 也许您只是想让您的应用程序向远程Web服务器发出一些HTTP请求,所以您需要可用于C ++的HTTP客户端库。

You could use libcurl for that purpose (it is a C library with HTTP client ability). 您可以为此目的使用libcurl (它是具有HTTP客户端功能的C库)。 If your application is graphical and uses Qt/KDE, you could also use the QtNetwork module or the QFtp or QHttp classes. 如果您的应用程序是图形的并且使用Qt / KDE,则还可以使用QtNetwork模块或QFtpQHttp类。 If it uses Gtk/Gnome, use the libsoup library 如果使用Gtk / Gnome,请使用libsoup

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM