本文整理汇总了C#中JsonReader.GetType方法的典型用法代码示例。如果您正苦于以下问题:C# JsonReader.GetType方法的具体用法?C# JsonReader.GetType怎么用?C# JsonReader.GetType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JsonReader
的用法示例。
在下文中一共展示了JsonReader.GetType方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PostTest1
IEnumerator PostTest1()
{
string str = @"";
// string like this
// str = @"{""Id"":0,""IMEI"":""String"",""Phone"":""String"",""Name"":""String"",""Status"":0,""CreateTime"":""\/Date(-62135596800000+0800)\/"",""UpdateTime"":""\/Date(-62135596800000+0800)\/""}";
// write Json
JsonWriter writer = new JsonWriter();
writer.WriteObjectStart();
writer.WritePropertyName("Id");
writer.Write(0);
writer.WritePropertyName("IMEI");
writer.Write("7654321");
writer.WritePropertyName("Phone");
writer.Write("13802817183");
writer.WritePropertyName("Name");
writer.Write("bbzm");
writer.WritePropertyName("Status");
writer.Write("1");
writer.WritePropertyName("CreateTime");
writer.Write("2013-01-01");
writer.WritePropertyName("UpdateTime");
writer.Write("2013-10-10");
writer.WriteObjectEnd();
str = writer.ToString();
Debug.Log(str);
WWWForm parameter = new WWWForm();
parameter.AddField("Body", str);
WWW postRequest = new WWW(@"http://192.168.133.225:82/Client/123456?format=json", parameter);
yield return postRequest;
JsonReader read = new JsonReader(postRequest.text);
Debug.Log(postRequest.text);
Debug.Log(" ----------------- ");
while (read.Read())
{
Debug.Log(read.Token + " : " + read.Value + " : " + read.GetType().ToString());
}
Debug.Log(" ----------------- ");
}