/// <summary> /// 从资源中得到流 /// </summary> /// <param name="assembly"></param> /// <param name="path"></param> /// <returns></returns> public static Stream GetResourceStream(Assembly assembly, string path) { ExceptionHelper.FalseThrow <ArgumentNullException>(assembly != null, "assembly"); ExceptionHelper.CheckStringIsNullOrEmpty(path, "path"); Stream stm = assembly.GetManifestResourceStream(path); ExceptionHelper.FalseThrow(stm != null, "不能在Assembly:{0}中找到资源{1}", assembly.FullName, path); return(stm); }
public static Type GetTypeInfo(string typeDescription) { ExceptionHelper.CheckStringIsNullOrEmpty(typeDescription, "typeDescription"); Type result = Type.GetType(typeDescription); if (result == null) { TypeInfo ti = GenerateTypeInfo(typeDescription); } return(result); }