遍历Resources

using System;
using System.Collections;
using System.Resources;
namespace ConsoleS2H
{
    class Program
    {
  
        static void Main(string[] args)
        {
            // Create a ResXResourceReader for the file items.resx.
            ResXResourceReader rsxr = new ResXResourceReader("address.resx");

            // Iterate through the resources and display the contents to the console.
            foreach (DictionaryEntry d in rsxr)
            {
                Console.WriteLine(d.Key.ToString() + ":\t" + d.Value.ToString()+":\t");
            }
            //Close the reader.
            rsxr.Close();
            Console.ReadLine();
        }
    }
}

posted on 2010-12-06 17:01  shaya  阅读(775)  评论(0编辑  收藏  举报

导航