Csharp/C Sharp/GUI Windows Form/ResourceManager

Материал из .Net Framework эксперт
Перейти к: навигация, поиск

Reading from a String Resource

using System;
using System.Drawing;
using System.Windows.Forms;
using System.Resources;
using System.Reflection;
   
public class MainForm
{
    public static void Main()
    {
        ResourceManager FormResources = new ResourceManager("StringTable", Assembly.GetExecutingAssembly());
        string          Message;
        
        Message = FormResources.GetString("Message");
        MessageBox.Show(Message);
    }
}