Loads a resource given an assembly-relative resource name and an anchor type.
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Reflection;
using System.Xml;
using System.Web;
/// <summary>
/// Common utility functions.
/// </summary>
publicstaticclass Util
{
/// <summary>
/// Loads a resource given an assembly-relative resource name and an anchor type.
/// </summary>
publicstatic Stream GetResourceAsStream<T>(string name)
{
Assembly a = typeof(T).Assembly;
return a.GetManifestResourceStream(a.GetName().Name + "." + name);
}
}