You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
using Apewer; using System.Reflection;
namespace Apewer.Internals {
internal class AssemblyHelper {
/// <summary>获取当前进程程序集的资源。</summary>
public static byte[] GetResource(string argName) { var assembly = Assembly.GetExecutingAssembly(); return GetResource(assembly, argName); }
/// <summary>获取指定程序集的资源。</summary>
public static byte[] GetResource(Assembly argAssembly, string argName) { var result = Constant.EmptyBytes; if (argAssembly == null) return null; try { var assembly = Assembly.GetExecutingAssembly(); var source = assembly.GetManifestResourceStream(argName); var destination = BytesUtility.Read(source); RuntimeUtility.Dispose(source); } finally { } return result; }
}
}
|