C#根据字符串获取对应类型(Type)

public static Type GetTypeByString(string type)
        {
            switch (type.ToLower())
            {
                case "bool":
                    return Type.GetType("System.Boolean"truetrue);
                case "byte":
                    return Type.GetType("System.Byte"truetrue);
                case "sbyte":
                    return Type.GetType("System.SByte"truetrue);
                case "char":
                    return Type.GetType("System.Char"truetrue);
                case "decimal":
                    return Type.GetType("System.Decimal"truetrue);
                case "double":
                    return Type.GetType("System.Double"truetrue);
                case "float":
                    return Type.GetType("System.Single"truetrue);
                case "int":
                    return Type.GetType("System.Int32"truetrue);
                case "uint":
                    return Type.GetType("System.UInt32"truetrue);
                case "long":
                    return Type.GetType("System.Int64"truetrue);
                case "ulong":
                    return Type.GetType("System.UInt64"truetrue);
                case "object":
                    return Type.GetType("System.Object"truetrue);
                case "short":
                    return Type.GetType("System.Int16"truetrue);
                case "ushort":
                    return Type.GetType("System.UInt16"truetrue);
                case "string":
                    return Type.GetType("System.String"truetrue);
                case "date":
                case "datetime":
                    return Type.GetType("System.DateTime"truetrue);
                case "guid":
                    return Type.GetType("System.Guid"truetrue);
                default:
                    return Type.GetType(type, truetrue);
            }
        }