public static string generateUserCachePath()
{
try
{
string pathToUserProf;
if (Registry.GetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\ArcGISSolutions\DesktopTools", "ConfigLocation", null) != null)
{
pathToUserProf = Registry.GetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\ArcGISSolutions\DesktopTools", "ConfigLocation", null) as string;
}
else if (Registry.GetValue(@"HKEY_CURRENT_USER\SOFTWARE\ArcGISSolutions\DesktopTools", "ConfigLocation", null) != null)
{
pathToUserProf = Registry.GetValue(@"HKEY_CURRENT_USER\SOFTWARE\ArcGISSolutions\DesktopTools", "ConfigLocation", null) as string;
}
else
{
pathToUserProf = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "ArcGISSolutions\\ConfigFiles");
}
if (System.IO.Directory.Exists(pathToUserProf) == false)
{
System.IO.Directory.CreateDirectory(pathToUserProf);
}
return pathToUserProf;
}
catch (Exception ex)
{
MessageBox.Show("generateUserCachePath: " + ex.Message);
return "";
}
}