using System;
namespace Test
{
    
class Program
    {
        
static void Main(string[] args)
        {
            
object m = ConvertObject.ToType(typeof(DateTime), "2000-9-9");
        }
    }
    
public class ConvertObject
    {
        
public static object ToType(Type type, object value)
        {
            
return System.ComponentModel.TypeDescriptor.GetConverter(type).ConvertFrom(value);
        }
    }
}

相关文章:

  • 2021-09-12
  • 2022-12-23
  • 2021-11-18
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-22
  • 2021-04-15
猜你喜欢
  • 2022-01-19
  • 2021-06-17
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案