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