Feedback

C# - Loads an embedded resource file of the calling assembly.

Veröffentlicht von am 10/4/2007
(1 Bewertungen)
Loads an embedded resource file of the calling assembly.
/// <summary>
/// Loads an embedded resource file of the calling assembly.
/// </summary>
/// <param name="embeddedFileName">Filename to load, e.g. "data.xml"</param>
/// <returns>Stream to the embedded resource</returns>
public static Stream GetResourceStream(string embeddedFileName) {
    Stream stream = Assembly.GetCallingAssembly().GetManifestResourceStream(Assembly.GetCallingAssembly().GetName().Name + ".Resources." + embeddedFileName);
    return stream;
}

Kommentare zum Snippet

 

Logge dich ein, um hier zu kommentieren!