[Mono-list] Getting countries, application directory and evolution interaction

Manuel de la Pena manuel.mps at mac.com
Sat Aug 18 15:55:58 EDT 2007


Hi guys,

I'm developing an application and in one point I want to get a list  
of all the countries, I have found the following code that works on  
windows:

  private void GetCountries()
   {
    RegistryKey countries =
     Registry.LocalMachine.OpenSubKey(
      "Software\\Microsoft\\Windows\\CurrentVersion" +
      "\\Telephony\\Country List");

    if ( countries!=null )
    {
     // Clear the list
     lvCountries.Items.Clear();

     // Get the list of subkeys,
     // which is actually the country code
     string[] subkeys = countries.GetSubKeyNames();

     foreach(string ccode in subkeys)
     {
      // Open the subkey, to get the country name
      RegistryKey country = countries.OpenSubKey(ccode);

      // ..get the country name from country key
      string countryName = country.GetValue("Name").ToString();
      // .. save it wherever you like

      // We're done using the key, we should close it
      country.Close();
     }

     // It's now safe to close the country list key
     countries.Close();
    }
   }

Is there any possible way to achieve this with mono on Linux?!?!  I  
also have an other problem regarding the following code (I'm sure  
some one has already answer this):

if (!Environment.OSVersion.ToString().StartsWith("Unix"))//working on  
windows
             {
                 myDocsPath = System.Environment.GetFolderPath 
(Environment.SpecialFolder.ApplicationData)
                     + @"\Macaque\MacaqueDB.db";

                 if (!Directory.Exists 
(System.Environment.GetFolderPath 
(Environment.SpecialFolder.ApplicationData)
                     + @"\Macaque\Images"))
                 {
                     Directory.CreateDirectory 
(System.Environment.GetFolderPath 
(Environment.SpecialFolder.ApplicationData)
                     + @"\Macaque\Images");
                 }
             }

             else if (Environment.OSVersion.ToString().StartsWith 
("Unix"))//working with mono
             {
             }
}

What should I do on Linux, I know I should store my application in  
the user folder in something like .Macaque or something like. Any  
idea???
An one last thing, those anyone how to interact with evolution throw  
Mono.??

Thanks in advanced :)


More information about the Mono-list mailing list