Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/280.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何从TypeConverter获取相应的类型?_C#_.net_Typeconverter - Fatal编程技术网

C# 如何从TypeConverter获取相应的类型?

C# 如何从TypeConverter获取相应的类型?,c#,.net,typeconverter,C#,.net,Typeconverter,在.NET中,我知道我可以得到一个给定类型的 TypeDescriptor.GetConverter(typeof(DateTime)) 但是,如果通过其他方式指定类型转换器对象,我如何知道它转换为什么类型?CanConvertTo方法可能会有所帮助。不知道这是否可能与反射有关。

在.NET中,我知道我可以得到一个给定类型的

TypeDescriptor.GetConverter(typeof(DateTime))
但是,如果通过其他方式指定类型转换器对象,我如何知道它转换为什么类型?

CanConvertTo方法可能会有所帮助。不知道这是否可能与反射有关。