//sCode是 SN001,OK 类型的数组
string[] STATUS = new string[0];
StringWriter sw = new StringWriter();
JsonWriter writer = new JsonTextWriter(sw);
writer.WriteStartObject();
for (int i = 0; i < nCount; i++)
{
//生成{ "SN001":"OK","SN002":"OK"}类型的字符串
STATUS = sCode[i].Split(',');
writer.WritePropertyName(STATUS[0]);
writer.WriteValue(STATUS[1]);
}
writer.WriteEndObject();
writer.Flush();
string jsonText = sw.GetStringBuilder().ToString();
return jsonText;