6 |
|
using System.Security; // Security Exception |
7 |
|
using System.Windows.Forms; // Message Box |
8 |
|
using System.Text.RegularExpressions; // For validate MAC address |
9 |
+ |
using log4net; |
10 |
|
|
11 |
|
namespace AnywhereTS |
12 |
|
{ |
323 |
|
else |
324 |
|
{ |
325 |
|
MessageBox.Show("Error when reading from registry (55222). Value missing. Key: " + regKey + " Value: " + regValue); |
326 |
< |
using (log4net.NDC.Push(string.Format("SqlException: MESSAGE={0}{1}Diagnostics:{1}{2}", e.Message, System.Environment.NewLine, e.ToString()))) |
326 |
< |
{ |
326 |
> |
|
327 |
|
using (log4net.NDC.Push(string.Format("key={0} value={1}", regKey, regValue))) |
328 |
|
{ |
329 |
|
using (log4net.NDC.Push("Value is missing")) |
331 |
|
Logging.ATSAdminLog.Error("Error when reading from registry."); |
332 |
|
} |
333 |
|
} |
334 |
< |
} |
334 |
> |
|
335 |
|
Application.Exit(); |
336 |
|
return 0; |
337 |
|
} |
339 |
|
else |
340 |
|
{ |
341 |
|
MessageBox.Show("Error when reading from registry (55221). Key missing. Key: " + regKey + " Value: " + regValue); |
342 |
< |
using (log4net.NDC.Push(string.Format("SqlException: MESSAGE={0}{1}Diagnostics:{1}{2}", e.Message, System.Environment.NewLine, e.ToString()))) |
343 |
< |
{ |
342 |
> |
|
343 |
|
using (log4net.NDC.Push(string.Format("key={0} value={1}", regKey, regValue))) |
344 |
|
{ |
345 |
|
using (log4net.NDC.Push("Key is missing")) |
347 |
|
Logging.ATSAdminLog.Error("Error when reading from registry."); |
348 |
|
} |
349 |
|
} |
350 |
< |
} |
350 |
> |
|
351 |
|
Application.Exit(); |
352 |
|
} |
353 |
|
return 0; // No value could be retrieved from registry |
514 |
|
else |
515 |
|
{ |
516 |
|
MessageBox.Show("Error when writing to registry (65222). Key missing. Key: " + regKey + " Value: " + regValue); |
517 |
< |
using (log4net.NDC.Push(string.Format("SqlException: MESSAGE={0}{1}Diagnostics:{1}{2}", e.Message, System.Environment.NewLine, e.ToString()))) |
519 |
< |
{ |
520 |
< |
using (log4net.NDC.Push(string.Format("key={0} value={1}", regKey, regValue))) |
517 |
> |
using (log4net.NDC.Push(string.Format("key={0} value={1}", regKey, regValue))) |
518 |
|
{ |
519 |
|
using (log4net.NDC.Push("Key is missing")) |
520 |
|
{ |
521 |
|
Logging.ATSAdminLog.Error("Error when writing to registry."); |
522 |
|
} |
523 |
|
} |
524 |
< |
} |
524 |
> |
|
525 |
|
Application.Exit(); |
526 |
|
} |
527 |
|
} |
535 |
|
{ |
536 |
|
objRegkey = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(regKey); |
537 |
|
} |
538 |
< |
catch (ArgumentNullException) |
538 |
> |
catch (ArgumentNullException e) |
539 |
|
{ |
540 |
|
MessageBox.Show("Error when reading from registry. Installation info missing, please run the " + ATSGlobals.ApplicationName + " installation program. (29411)"); |
541 |
|
using (log4net.NDC.Push(string.Format("SqlException: MESSAGE={0}{1}Diagnostics:{1}{2}", e.Message, System.Environment.NewLine, e.ToString()))) |
595 |
|
else |
596 |
|
{ |
597 |
|
MessageBox.Show("Error when reading from registry (59221). Key missing. Key: " + regKey + " Value: " + strRegTFTP_root); |
598 |
< |
using (log4net.NDC.Push(string.Format("SqlException: MESSAGE={0}{1}Diagnostics:{1}{2}", e.Message, System.Environment.NewLine, e.ToString()))) |
602 |
< |
{ |
598 |
> |
|
599 |
|
using (log4net.NDC.Push(string.Format("key={0} value={1}", regKey, regValue))) |
600 |
|
{ |
601 |
|
using (log4net.NDC.Push("Key is missing")) |
603 |
|
Logging.ATSAdminLog.Error("Error when reading from registry."); |
604 |
|
} |
605 |
|
} |
606 |
< |
} |
606 |
> |
|
607 |
|
Application.Exit(); |
608 |
|
} |
609 |
|
return false; // No value could be retrieved from registry |
775 |
|
else |
776 |
|
{ |
777 |
|
MessageBox.Show("Error when reading from registry (95221). Key missing. Key: " + regKey + " Value: " + strRegTFTP_root); |
778 |
< |
using (log4net.NDC.Push(string.Format("SqlException: MESSAGE={0}{1}Diagnostics:{1}{2}", e.Message, System.Environment.NewLine, e.ToString()))) |
783 |
< |
{ |
778 |
> |
|
779 |
|
using (log4net.NDC.Push(string.Format("key={0} value={1}", regKey, regValue))) |
780 |
|
{ |
781 |
|
Logging.ATSAdminLog.Error("Error when reading from registry."); |
782 |
|
} |
783 |
< |
} |
783 |
> |
|
784 |
|
Application.Exit(); |
785 |
|
} |
786 |
|
} |
852 |
|
else |
853 |
|
{ |
854 |
|
MessageBox.Show("Error when reading from registry (95221). Key missing. Key: " + regKey + " Value: " + strRegTFTP_root); |
855 |
< |
using (log4net.NDC.Push(string.Format("SqlException: MESSAGE={0}{1}Diagnostics:{1}{2}", e.Message, System.Environment.NewLine, e.ToString()))) |
861 |
< |
{ |
855 |
> |
|
856 |
|
using (log4net.NDC.Push(string.Format("key={0} value={1}", regKey, regValue))) |
857 |
|
{ |
858 |
|
Logging.ATSAdminLog.Error("Error when reading from registry."); |
859 |
|
} |
860 |
< |
} |
860 |
> |
|
861 |
|
Application.Exit(); |
862 |
|
} |
863 |
|
} |