using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Json;
namespace StackOverflowQuestion
{
class StackOverflowQuestion
{
public StackOverflowQuestion()
{
JsonObject jsonObj = new JsonObject();
string[] arr = { "first_value", "second_value", "third_value" };
obj.Add("array", arr); // Compiler cannot convert string[] to System.Json.JsonValue
}
}
}
I wie in Ergebnis Json Objekt erhalten möchtenWie konvertiert man Array (string []) in JsonValue?
{"array":["first_value","second_value","third_value"]"}
nicht JavaScriptSerializer verwenden. Es ist veraltet. Microsoft selbst verwendet Json.NET –