Welcome my friend. Here is Standing's lifetime miracle......

Always Standing

Lifetime...
使用资源文件using ResourceManager
using System;
using System.Resources;
using System.Threading;
using System.Reflection;
using System.Globalization;
class ResourcesExample 
{
    
public static void Main() 
    
{
        
// Create a resource manager to retrieve resources.
        ResourceManager rm = new ResourceManager("resourceManager.Application"
            Assembly.GetExecutingAssembly());

    
// Get the culture of the currently executing thread.
    
// The value of ci will determine the culture of
    
// the resources that the resource manager retrieves.
    CultureInfo ci = Thread.CurrentThread.CurrentCulture;

    
    
// Retrieve the value of the string resource named 
    
// "welcome", localized for the culture specified by ci.
    String str = rm.GetString("welcome", System.Globalization.CultureInfo.CurrentCulture);
    Console.WriteLine(str);
    }

}

资源文件必须写成,程序集名字.资源文件名不包括扩展名

posted on 2006-02-06 17:32  Standing  阅读(3966)  评论(2)    收藏  举报