Click here to Skip to main content
15,881,715 members
Articles / Desktop Programming / MFC

Ramakrishna's Code Project Screen Saver

Rate me:
Please Sign up or sign in to vote.
4.29/5 (4 votes)
19 May 2002CPOL9 min read 197.2K   2.3K   31  
This is a screen saver written in C# and Managed C++ to display data from The Code Project web site
using System;
using System.Resources;
using System.Configuration;
using System.Reflection;
using System.Drawing;

namespace CP.Apps.ScreenSaver
{
	/// <summary>
	/// A class that is used to extract resources
	/// </summary>
	public class Res
	{
		private static ResourceManager resMgr;
		private static string imageManifestName = "CP.Apps.ScreenSaver.Images.";

		static Res()
		{
			//Allow for localization in future
			Assembly assembly = Assembly.GetExecutingAssembly();
			resMgr = new ResourceManager("CP.Apps.ScreenSaver.CPRama", assembly);
		}
	
		public static string GetString(string name)
		{
			return resMgr.GetString(name);
		}

		public static Image GetImage(string name)
		{
			Assembly assembly = Assembly.GetExecutingAssembly();
			return Image.FromStream(assembly.GetManifestResourceStream(imageManifestName + name));
		}
	}
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Architect
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions