我有我想在C#程序中使用的JSON字符串。
var responseBytes = "{ "class":"TPV","device":"tcp://172.19.34.3:50000","mode":3,"time":"2017-09-20T02:55:15.000Z","ept":0.005,"lat":-36.853230000,"lon":174.773626667,"alt":40.200,"epv":23.000,"track":246.3700,"speed":0.000,"climb":0.000,"epc":46.00}";
但是我的VisualStudio编辑器显示上述变形的错误。这可能是因为缺少逃脱字符。我该如何解决?
答案 0 :(得分:3)
不能直接使用“内部”
解决这个问题\“Double引用中的所有引用
或在双引号内使用'except'
var responseBytes = "{ \"class\":\"TPV\",\"device\":\"tcp:172.19.34.3:50000\",\"mode\":3,\"time\":\"2017-09-20T02:55:15.000Z\",\"ept\":0.005,\"lat\":-36.853230000,\"lon\":174.773626667,\"alt\":40.200,\"epv\":23.000,\"track\":246.3700,\"speed\":0.000,\"climb\":0.000,\"epc\":46.00}";