如何在C#和C ++之间发送json数据 [英] How can I send json data between C# and C++

查看:379
本文介绍了如何在C#和C ++之间发送json数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在C#和C ++之间发送和接收json数据。



i在我的c#代码中有一个json数据,我需要将数据发送到c ++和作为重播,我需要将另一个json数据发送到c#。

可以解释一下如何使用C ++ / CLI包装器来解决这个问题。



我尝试了什么:



i对如何在托管代码和非托管代码之间发送JSON数据没有一个明确的想法。请帮助我。

how can i send and receive json data between C# and C++.

i have a json data in my c# code and i need to send the data to c++ and as a replay i need to send another json data to c#.
could some one please explain how can i do this using C++/CLI wrapper.

What I have tried:

i don't have a clear idea on how to send the JSON data between managed and unmanaged code .please help me on this.

推荐答案

当它在同一个应用程序中时,最好使用C#interop并使用jason作为字符串参数进行调用。阅读我的文章和代码致电所有电台



如果它是不同的应用程序,它会有点困难。写一个临时文件或共享内存最好在同一台机器上。
When it is in the same app than you best use C# interop and make a call by using the jason as string parameter. Read my article and code Calling all stations.

If it are different apps it gets a bit difficulter. Writing an temporary file or shared memory is best for on the same machine.


这篇关于如何在C#和C ++之间发送json数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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