如何使用资源文件

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Resources;
using System.Reflection;

namespace ResourceTest
{
class Program
{
static void Main(string[] args)
{
try
{

ResourceManager rm = new ResourceManager("ResourceTest.Resource1",

Assembly.GetExecutingAssembly());

string C1 = rm.GetObject("C1") as string;

Console.WriteLine(C1);
Console.ReadKey();

}

catch (Exception ex)
{

 

}


}
}
}

posted @ 2016-05-17 13:12  FiberHomer  阅读(180)  评论(0编辑  收藏  举报