|
@@ -310,15 +310,19 @@ namespace ImpulseVision
|
|
|
private int GetCountDay()
|
|
|
{
|
|
|
int CountDay = 2;
|
|
|
- RegistryKey Reg = Registry.CurrentUser.OpenSubKey("Software\\ImpulseVisionApp");
|
|
|
- if (Reg != null)
|
|
|
+ try
|
|
|
{
|
|
|
- if(Reg.GetValue("countDay") != null)
|
|
|
+ RegistryKey Reg = Registry.CurrentUser.OpenSubKey("Software\\ImpulseVisionApp");
|
|
|
+ if (Reg != null)
|
|
|
{
|
|
|
- CountDay = (int)Reg.GetValue("countDay");
|
|
|
+ if (Reg.GetValue("countDay") != null)
|
|
|
+ {
|
|
|
+ CountDay = (int)Reg.GetValue("countDay");
|
|
|
+ }
|
|
|
}
|
|
|
+ Reg.Close();
|
|
|
}
|
|
|
- Reg.Close();
|
|
|
+ catch { }
|
|
|
return CountDay;
|
|
|
}
|
|
|
/// <summary>
|