| 12345678910111213141516171819202122232425 | 
							- using System;
 
- namespace Masuit.Tools
 
- {
 
-     public static class IConvertibleExtensions
 
-     {
 
-         /// <summary>
 
-         /// 类型直转
 
-         /// </summary>
 
-         /// <typeparam name="T"></typeparam>
 
-         /// <param name="value"></param>
 
-         /// <returns></returns>
 
-         public static T To<T>(this IConvertible value)
 
-         {
 
-             try
 
-             {
 
-                 return (T)Convert.ChangeType(value, typeof(T));
 
-             }
 
-             catch
 
-             {
 
-                 return default;
 
-             }
 
-         }
 
-     }
 
- }
 
 
  |