using System.Windows.Forms;using System.Resources;using System.Collections;namespace ResourceFile{public partial class Form1 : Form{public Form1(){InitializeComponent();}private void saveToFile(){ResourceWriter rw = new ResourceWriter(@"C:\Temp\MyFile.resources");foreach (Control resource in Controls){if (resource.GetType() == typeof(NumericUpDown)){rw.AddResource(resource.Name, resource.Text);}}rw.Generate();rw.Close();} private void loadFromFile(){ResourceSet rs = new ResourceSet(@"C:\Temp\MyFile.resources");foreach (DictionaryEntry resource in rs){rs.GetObject(resource.Key.ToString());}rs.Close();}private void buttonSave_Click(object sender, System.EventArgs e){saveToFile();}private void buttonLoad_Click(object sender, System.EventArgs e){loadFromFile();}}}