C#里面如何判断一个Object是否是某种类型

var isA = oldObject.GetType() == typeof(Dictionary<string, string>)


var isB = oldObject.GetType().FullName.IndexOf("Dictionary") > 0;


var isC = oldObject is Dictionary<string, string>;
posted @ 2021-05-19 16:14  清语堂  阅读(406)  评论(0编辑  收藏  举报