标签:Convert
object存储一个int,强转为double抛出异常,ConvertTo就OK
class Program { private static void Main() { object obj = 1; Console.WriteLine(Convert.ToDouble(obj)); // why OK without exception? var d = (doubl……
01-31 立刻查看
class Program { private static void Main() { object obj = 1; Console.WriteLine(Convert.ToDouble(obj)); // why OK without exception? var d = (doubl……