微信app采集
This commit is contained in:
1 parent
52220daa8b
commit
2f61dc1cdd
67 files changed
+6197
-1118
No files matched your search
+12
-7
@@ -46,13 +46,18 @@ namespace AllBase
|
||||
|
||||
public static T DeserializeJsonToObjectNullable<T>(string json) where T : class
|
||||
{
|
||||
if (string.IsNullOrEmpty(json))
|
||||
return json as T;
|
||||
JsonSerializer serializer = new JsonSerializer();
|
||||
StringReader sr = new StringReader(json);
|
||||
object o = serializer.Deserialize(new JsonTextReader(sr), typeof(T));
|
||||
T t = o as T;
|
||||
return t;
|
||||
try
|
||||
{
|
||||
JsonSerializer serializer = new JsonSerializer();
|
||||
StringReader sr = new StringReader(json);
|
||||
object o = serializer.Deserialize(new JsonTextReader(sr), typeof(T));
|
||||
T t = o as T;
|
||||
return t;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static JObject JObjectParse(string json)
|
||||
|
||||
Reference in new issue
Block a user