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);
}
}
}
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);
}
}
}