How to determine if a object type is a built in system type

前端 未结 8 973
醉酒成梦
醉酒成梦 2020-12-14 00:20

I am writing a simple List to CSV converter. My converter checks the all the t\'s in List and grabs all public properties and places them

8条回答
  •  天涯浪人
    2020-12-14 00:57

    Here are a few of the several possibilities:

    • myName.GetType().Namespace == "System"
    • myName.GetType().Namespace.StartsWith("System")
    • myName.GetType().Module.ScopeName == "CommonLanguageRuntimeLibrary"

提交回复
热议问题