質問

I use this example to serialize a dictonary like this

Dictionary<object, object>

What I get is

{ "key": "value" }

what I need is

{ key: "value" }

How do I get this output?

役に立ちましたか?

解決

wrong approach - now I use a simple stringbuilder.

foreach (DictionaryEntry entry in xSet)
{
  result.AppendFormat("{0}: '{1}',", entry.Key, HttpUtility.JavaScriptStringEncode(entry.Value.ToString()));
}
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top