C++ 制作 json 数据 并 传送给服务端(Server) 的 php
发布时间:2020-12-15 04:43:44 所属栏目:百科 来源:网络整理
导读:json数据格式,这里举个基础的例子: ? ? ? {"name":"LGH"} 在C++里面,我用个函数把特定的数据组合成 json toJson( json[ result[ ] = * temp = * temp_1 = * temp_2 = _itoa(count,json, strcat(result, sendMessage(result); } 注意我里面的传送函数,选
json数据格式,这里举个基础的例子: ? ? ? {"name":"LGH"} 在C++里面,我用个函数把特定的数据组合成 json toJson( json[ result[] = * temp = * temp_1 = * temp_2 =
_itoa(count,json, strcat(result,
sendMessage(result);
}
注意我里面的传送函数,选择在里面执行,原因是,由 toJson 返回 char* result 会造成内存溢出,后来这样做,变为可以。 下面是sendMassage() 函数 sendMessage( *
url_for_lgh_connect_database[]=;
*x=
WCHAR exchange_text_from_url[],exchange_text_from_x[];
LPCWSTR py = LPCWSTR pz =
MultiByteToWideChar( ,,x,-,exchange_text_from_x, );
MultiByteToWideChar( ,url_for_lgh_connect_database,exchange_text_from_url,
(InternetAttemptConnect() != cout<<<< cout<<<<
(InternetOpenUrl(InternetOpen(x,INTERNET_OPEN_TYPE_DIRECT,NULL,NULL),NULL)==
cout<<<<
}
(编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |