Exemplo n.º 1
0
 // Load saved items from the Registry.
 private void LoadFiles()
 {
     // Reload items from the registry.
     for (int i = 0; i < NumFiles; i++)
     {
         string file_name = (string)RegistryTools.GetSetting(
             ApplicationName, "FilePath" + i.ToString(), "");
         if (file_name != "")
         {
             FileInfos.Add(new FileInfo(file_name));
         }
     }
 }
Exemplo n.º 2
0
        // Save the current items in the Registry.
        private void SaveFiles()
        {
            // Delete the saved entries.
            for (int i = 0; i < NumFiles; i++)
            {
                RegistryTools.DeleteSetting(ApplicationName, "FilePath" + i.ToString());
            }

            // Save the current entries.
            int index = 0;

            foreach (FileInfo file_info in FileInfos)
            {
                RegistryTools.SaveSetting(ApplicationName,
                                          "FilePath" + index.ToString(), file_info.FullName);
                index++;
            }
        }