160 |
{ |
{ |
161 |
objRegkey = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(regKey); |
objRegkey = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(regKey); |
162 |
} |
} |
163 |
catch (ArgumentNullException) |
catch (ArgumentNullException ex) |
164 |
{ |
{ |
165 |
MessageBox.Show("Error when reading from registry. Installation info missing, please run the " + ATSGlobals.ApplicationName + " installation program. (22411)"); |
MessageBox.Show("Error when reading from registry. Installation info missing, please run the " + ATSGlobals.ApplicationName + " installation program. (22411)"); |
166 |
|
using (log4net.NDC.Push(string.Format("SqlException: MESSAGE={0}{1}Diagnostics:{1}{2}", ex.Message, System.Environment.NewLine, ex.ToString()))) |
167 |
|
{ |
168 |
|
using (log4net.NDC.Push("Installation info missing.")) |
169 |
|
{ |
170 |
|
Logging.ATSAdminLog.Error("Error when reading from registry."); |
171 |
|
} |
172 |
|
} |
173 |
Application.Exit(); |
Application.Exit(); |
174 |
return ""; |
return ""; |
175 |
} |
} |
176 |
catch (SecurityException e) |
catch (SecurityException ex) |
177 |
{ |
{ |
178 |
MessageBox.Show("Error when reading from registry. You do not have the necessary permission (22412). Key: "+ regKey + " Value: " + regValue + " Error details:" + e.Message); |
MessageBox.Show("Error when reading from registry. You do not have the necessary permission (22412). Key: "+ regKey + " Value: " + regValue + " Error details:" + ex.Message); |
179 |
|
using (log4net.NDC.Push(string.Format("SqlException: MESSAGE={0}{1}Diagnostics:{1}{2}", ex.Message, System.Environment.NewLine, ex.ToString()))) |
180 |
|
{ |
181 |
|
using (log4net.NDC.Push(string.Format("key={0} value={1}", regKey, regValue))) |
182 |
|
{ |
183 |
|
using (log4net.NDC.Push("Invalid users rights.")) |
184 |
|
{ |
185 |
|
Logging.ATSAdminLog.Error("Error when reading from registry."); |
186 |
|
} |
187 |
|
} |
188 |
|
} |
189 |
Application.Exit(); |
Application.Exit(); |
190 |
return ""; |
return ""; |
191 |
} |
} |
192 |
catch (Exception e) |
catch (Exception ex) |
193 |
{ |
{ |
194 |
MessageBox.Show("Error when reading from registry (22413). Key: " + regKey + " Value: " + regValue + " Error details:" + e.Message); |
MessageBox.Show("Error when reading from registry (22413). Key: " + regKey + " Value: " + regValue + " Error details:" + ex.Message); |
195 |
|
using (log4net.NDC.Push(string.Format("SqlException: MESSAGE={0}{1}Diagnostics:{1}{2}", ex.Message, System.Environment.NewLine, ex.ToString()))) |
196 |
|
{ |
197 |
|
Logging.ATSAdminLog.Error("Error when reading from registry."); |
198 |
|
} |
199 |
Application.Exit(); |
Application.Exit(); |
200 |
return ""; |
return ""; |
201 |
} |
} |
211 |
catch (Exception e) |
catch (Exception e) |
212 |
{ |
{ |
213 |
MessageBox.Show("Error when reading from registry (22414). Key: " + regKey + " Value: " + regValue + " Error details:" + e.Message); |
MessageBox.Show("Error when reading from registry (22414). Key: " + regKey + " Value: " + regValue + " Error details:" + e.Message); |
214 |
|
using (log4net.NDC.Push(string.Format("SqlException: MESSAGE={0}{1}Diagnostics:{1}{2}", e.Message, System.Environment.NewLine, e.ToString()))) |
215 |
|
{ |
216 |
|
Logging.ATSAdminLog.Error("Error when reading from registry."); |
217 |
|
} |
218 |
Application.Exit(); |
Application.Exit(); |
219 |
return ""; |
return ""; |
220 |
} |
} |
222 |
else |
else |
223 |
{ |
{ |
224 |
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); |
225 |
|
using (log4net.NDC.Push(string.Format("key={0} value={1}", regKey, regValue))) |
226 |
|
{ |
227 |
|
using (log4net.NDC.Push("Value is missing")) |
228 |
|
{ |
229 |
|
Logging.ATSAdminLog.Error("Error when reading from registry."); |
230 |
|
} |
231 |
|
} |
232 |
Application.Exit(); |
Application.Exit(); |
233 |
return ""; |
return ""; |
234 |
} |
} |
236 |
else |
else |
237 |
{ |
{ |
238 |
MessageBox.Show("Error when reading from registry (55221). Key missing. Key: " + regKey + " Value: " + strRegTFTP_root); |
MessageBox.Show("Error when reading from registry (55221). Key missing. Key: " + regKey + " Value: " + strRegTFTP_root); |
239 |
|
using (log4net.NDC.Push(string.Format("key={0} value={1}", regKey, regValue))) |
240 |
|
{ |
241 |
|
using (log4net.NDC.Push("Key is missing")) |
242 |
|
{ |
243 |
|
Logging.ATSAdminLog.Error("Error when reading from registry."); |
244 |
|
} |
245 |
|
} |
246 |
Application.Exit(); |
Application.Exit(); |
247 |
} |
} |
248 |
return ""; // No value could be retrieved from registry |
return ""; // No value could be retrieved from registry |
257 |
{ |
{ |
258 |
objRegkey = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(regKey); |
objRegkey = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(regKey); |
259 |
} |
} |
260 |
catch (ArgumentNullException) |
catch (ArgumentNullException ex) |
261 |
{ |
{ |
262 |
MessageBox.Show("Error when reading from registry. Installation info missing, please run the " + ATSGlobals.ApplicationName + " installation program. (22411)"); |
MessageBox.Show("Error when reading from registry. Installation info missing, please run the " + ATSGlobals.ApplicationName + " installation program. (22411)"); |
263 |
|
using (log4net.NDC.Push(string.Format("SqlException: MESSAGE={0}{1}Diagnostics:{1}{2}", ex.Message, System.Environment.NewLine, ex.ToString()))) |
264 |
|
{ |
265 |
|
using (log4net.NDC.Push("Installation info missing.")) |
266 |
|
{ |
267 |
|
Logging.ATSAdminLog.Error("Error when reading from registry."); |
268 |
|
} |
269 |
|
} |
270 |
Application.Exit(); |
Application.Exit(); |
271 |
return 0; |
return 0; |
272 |
} |
} |
273 |
catch (SecurityException e) |
catch (SecurityException e) |
274 |
{ |
{ |
275 |
MessageBox.Show("Error when reading from registry. You do not have the necessary permission (22412). Key: " + regKey + " Value: " + regValue + " Error details:" + e.Message); |
MessageBox.Show("Error when reading from registry. You do not have the necessary permission (22412). Key: " + regKey + " Value: " + regValue + " Error details:" + e.Message); |
276 |
|
using (log4net.NDC.Push(string.Format("SqlException: MESSAGE={0}{1}Diagnostics:{1}{2}", e.Message, System.Environment.NewLine, e.ToString()))) |
277 |
|
{ |
278 |
|
using (log4net.NDC.Push(string.Format("key={0} value={1}", regKey, regValue))) |
279 |
|
{ |
280 |
|
using (log4net.NDC.Push("Invalid user rights.")) |
281 |
|
{ |
282 |
|
Logging.ATSAdminLog.Error("Error when reading from registry."); |
283 |
|
} |
284 |
|
} |
285 |
|
} |
286 |
Application.Exit(); |
Application.Exit(); |
287 |
return 0; |
return 0; |
288 |
} |
} |
289 |
catch (Exception e) |
catch (Exception e) |
290 |
{ |
{ |
291 |
MessageBox.Show("Error when reading from registry (22413). Key: " + regKey + " Value: " + regValue + " Error details:" + e.Message); |
MessageBox.Show("Error when reading from registry (22413). Key: " + regKey + " Value: " + regValue + " Error details:" + e.Message); |
292 |
|
using (log4net.NDC.Push(string.Format("SqlException: MESSAGE={0}{1}Diagnostics:{1}{2}", e.Message, System.Environment.NewLine, e.ToString()))) |
293 |
|
{ |
294 |
|
Logging.ATSAdminLog.Error("Error when reading from registry."); |
295 |
|
} |
296 |
Application.Exit(); |
Application.Exit(); |
297 |
return 0; |
return 0; |
298 |
} |
} |
308 |
catch (Exception e) |
catch (Exception e) |
309 |
{ |
{ |
310 |
MessageBox.Show("Error when reading from registry (22414). Key: " + regKey + " Value: " + regValue + " Error details:" + e.Message); |
MessageBox.Show("Error when reading from registry (22414). Key: " + regKey + " Value: " + regValue + " Error details:" + e.Message); |
311 |
|
using (log4net.NDC.Push(string.Format("SqlException: MESSAGE={0}{1}Diagnostics:{1}{2}", e.Message, System.Environment.NewLine, e.ToString()))) |
312 |
|
{ |
313 |
|
using (log4net.NDC.Push(string.Format("key={0} value={1}", regKey, regValue))) |
314 |
|
{ |
315 |
|
Logging.ATSAdminLog.Error("Error when reading from registry."); |
316 |
|
} |
317 |
|
} |
318 |
Application.Exit(); |
Application.Exit(); |
319 |
return 0; |
return 0; |
320 |
} |
} |
322 |
else |
else |
323 |
{ |
{ |
324 |
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); |
325 |
|
using (log4net.NDC.Push(string.Format("SqlException: MESSAGE={0}{1}Diagnostics:{1}{2}", e.Message, System.Environment.NewLine, e.ToString()))) |
326 |
|
{ |
327 |
|
using (log4net.NDC.Push(string.Format("key={0} value={1}", regKey, regValue))) |
328 |
|
{ |
329 |
|
using (log4net.NDC.Push("Value is missing")) |
330 |
|
{ |
331 |
|
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 |
|
{ |
344 |
|
using (log4net.NDC.Push(string.Format("key={0} value={1}", regKey, regValue))) |
345 |
|
{ |
346 |
|
using (log4net.NDC.Push("Key is missing")) |
347 |
|
{ |
348 |
|
Logging.ATSAdminLog.Error("Error when reading from registry."); |
349 |
|
} |
350 |
|
} |
351 |
|
} |
352 |
Application.Exit(); |
Application.Exit(); |
353 |
} |
} |
354 |
return 0; // No value could be retrieved from registry |
return 0; // No value could be retrieved from registry |
363 |
{ |
{ |
364 |
objRegkey = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(regKey,true); |
objRegkey = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(regKey,true); |
365 |
} |
} |
366 |
catch (ArgumentNullException) |
catch (ArgumentNullException e) |
367 |
{ |
{ |
368 |
MessageBox.Show("Error when writing to registry. Installation info missing, please run the " + ATSGlobals.ApplicationName + " installation program. (62411)"); |
MessageBox.Show("Error when writing to registry. Installation info missing, please run the " + ATSGlobals.ApplicationName + " installation program. (62411)"); |
369 |
|
using (log4net.NDC.Push(string.Format("SqlException: MESSAGE={0}{1}Diagnostics:{1}{2}", e.Message, System.Environment.NewLine, e.ToString()))) |
370 |
|
{ |
371 |
|
using (log4net.NDC.Push("Installation info missing")) |
372 |
|
{ |
373 |
|
Logging.ATSAdminLog.Error("Error when writing to registry."); |
374 |
|
} |
375 |
|
} |
376 |
Application.Exit(); |
Application.Exit(); |
377 |
return; |
return; |
378 |
} |
} |
379 |
catch (SecurityException e) |
catch (SecurityException e) |
380 |
{ |
{ |
381 |
MessageBox.Show("Error when writing to registry. You do not have the necessary permission (62412). Key: " + regKey + " Value: " + regValue + " Error details:" + e.Message); |
MessageBox.Show("Error when writing to registry. You do not have the necessary permission (62412). Key: " + regKey + " Value: " + regValue + " Error details:" + e.Message); |
382 |
|
using (log4net.NDC.Push(string.Format("SqlException: MESSAGE={0}{1}Diagnostics:{1}{2}", e.Message, System.Environment.NewLine, e.ToString()))) |
383 |
|
{ |
384 |
|
using (log4net.NDC.Push(string.Format("key={0} value={1}", regKey, regValue))) |
385 |
|
{ |
386 |
|
using (log4net.NDC.Push("Invalid user rights")) |
387 |
|
{ |
388 |
|
Logging.ATSAdminLog.Error("Error when writing to registry."); |
389 |
|
} |
390 |
|
} |
391 |
|
} |
392 |
Application.Exit(); |
Application.Exit(); |
393 |
return; |
return; |
394 |
} |
} |
395 |
catch (Exception e) |
catch (Exception e) |
396 |
{ |
{ |
397 |
MessageBox.Show("Error when reading from registry (62413). Key: " + regKey + " Value: " + regValue + " Error details:" + e.Message); |
MessageBox.Show("Error when reading from registry (62413). Key: " + regKey + " Value: " + regValue + " Error details:" + e.Message); |
398 |
|
using (log4net.NDC.Push(string.Format("SqlException: MESSAGE={0}{1}Diagnostics:{1}{2}", e.Message, System.Environment.NewLine, e.ToString()))) |
399 |
|
{ |
400 |
|
using (log4net.NDC.Push(string.Format("key={0} value={1}", regKey, regValue))) |
401 |
|
{ |
402 |
|
Logging.ATSAdminLog.Error("Error when reading from registry."); |
403 |
|
} |
404 |
|
} |
405 |
Application.Exit(); |
Application.Exit(); |
406 |
return; |
return; |
407 |
} |
} |
415 |
catch (Exception e) |
catch (Exception e) |
416 |
{ |
{ |
417 |
MessageBox.Show("Error when writing to registry (62414). Key: " + regKey + " Value: " + regValue + " Error details:" + e.Message); |
MessageBox.Show("Error when writing to registry (62414). Key: " + regKey + " Value: " + regValue + " Error details:" + e.Message); |
418 |
|
using (log4net.NDC.Push(string.Format("SqlException: MESSAGE={0}{1}Diagnostics:{1}{2}", e.Message, System.Environment.NewLine, e.ToString()))) |
419 |
|
{ |
420 |
|
using (log4net.NDC.Push(string.Format("key={0} value={1}", regKey, regValue))) |
421 |
|
{ |
422 |
|
Logging.ATSAdminLog.Error("Error when writing to registry."); |
423 |
|
} |
424 |
|
} |
425 |
Application.Exit(); |
Application.Exit(); |
426 |
} |
} |
427 |
} |
} |
428 |
else |
else |
429 |
{ |
{ |
430 |
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); |
431 |
|
|
432 |
|
using (log4net.NDC.Push(string.Format("key={0} value={1}", regKey, regValue))) |
433 |
|
{ |
434 |
|
using (log4net.NDC.Push("Key is missing")) |
435 |
|
{ |
436 |
|
Logging.ATSAdminLog.Error("Error when writing to registry."); |
437 |
|
} |
438 |
|
} |
439 |
|
|
440 |
Application.Exit(); |
Application.Exit(); |
441 |
} |
} |
442 |
} |
} |
450 |
{ |
{ |
451 |
objRegkey = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(regKey, true); |
objRegkey = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(regKey, true); |
452 |
} |
} |
453 |
catch (ArgumentNullException) |
catch (ArgumentNullException e) |
454 |
{ |
{ |
455 |
MessageBox.Show("Error when writing to registry. Installation info missing, please run the " + ATSGlobals.ApplicationName + " installation program. (62411)"); |
MessageBox.Show("Error when writing to registry. Installation info missing, please run the " + ATSGlobals.ApplicationName + " installation program. (62411)"); |
456 |
|
using (log4net.NDC.Push(string.Format("SqlException: MESSAGE={0}{1}Diagnostics:{1}{2}", e.Message, System.Environment.NewLine, e.ToString()))) |
457 |
|
{ |
458 |
|
using (log4net.NDC.Push(string.Format("key={0} value={1}", regKey, regValue))) |
459 |
|
{ |
460 |
|
Logging.ATSAdminLog.Error("Error when writing to registry."); |
461 |
|
} |
462 |
|
} |
463 |
Application.Exit(); |
Application.Exit(); |
464 |
return; |
return; |
465 |
} |
} |
466 |
catch (SecurityException e) |
catch (SecurityException e) |
467 |
{ |
{ |
468 |
MessageBox.Show("Error when writing to registry. You do not have the necessary permission (62412). Key: " + regKey + " Value: " + regValue + " Error details:" + e.Message); |
MessageBox.Show("Error when writing to registry. You do not have the necessary permission (62412). Key: " + regKey + " Value: " + regValue + " Error details:" + e.Message); |
469 |
|
using (log4net.NDC.Push(string.Format("SqlException: MESSAGE={0}{1}Diagnostics:{1}{2}", e.Message, System.Environment.NewLine, e.ToString()))) |
470 |
|
{ |
471 |
|
using (log4net.NDC.Push(string.Format("key={0} value={1}", regKey, regValue))) |
472 |
|
{ |
473 |
|
using (log4net.NDC.Push("Invalid user rights")) |
474 |
|
{ |
475 |
|
Logging.ATSAdminLog.Error("Error when writing to registry."); |
476 |
|
} |
477 |
|
} |
478 |
|
} |
479 |
Application.Exit(); |
Application.Exit(); |
480 |
return; |
return; |
481 |
} |
} |
482 |
catch (Exception e) |
catch (Exception e) |
483 |
{ |
{ |
484 |
MessageBox.Show("Error when reading from registry (62413). Key: " + regKey + " Value: " + regValue + " Error details:" + e.Message); |
MessageBox.Show("Error when reading from registry (62413). Key: " + regKey + " Value: " + regValue + " Error details:" + e.Message); |
485 |
|
using (log4net.NDC.Push(string.Format("SqlException: MESSAGE={0}{1}Diagnostics:{1}{2}", e.Message, System.Environment.NewLine, e.ToString()))) |
486 |
|
{ |
487 |
|
using (log4net.NDC.Push(string.Format("key={0} value={1}", regKey, regValue))) |
488 |
|
{ |
489 |
|
Logging.ATSAdminLog.Error("Error when reading from registry."); |
490 |
|
} |
491 |
|
} |
492 |
Application.Exit(); |
Application.Exit(); |
493 |
return; |
return; |
494 |
} |
} |
502 |
catch (Exception e) |
catch (Exception e) |
503 |
{ |
{ |
504 |
MessageBox.Show("Error when writing to registry (62414). Key: " + regKey + " Value: " + regValue + " Error details:" + e.Message); |
MessageBox.Show("Error when writing to registry (62414). Key: " + regKey + " Value: " + regValue + " Error details:" + e.Message); |
505 |
|
using (log4net.NDC.Push(string.Format("SqlException: MESSAGE={0}{1}Diagnostics:{1}{2}", e.Message, System.Environment.NewLine, e.ToString()))) |
506 |
|
{ |
507 |
|
using (log4net.NDC.Push(string.Format("key={0} value={1}", regKey, regValue))) |
508 |
|
{ |
509 |
|
Logging.ATSAdminLog.Error("Error when writing to registry."); |
510 |
|
} |
511 |
|
} |
512 |
Application.Exit(); |
Application.Exit(); |
513 |
} |
} |
514 |
} |
} |
515 |
else |
else |
516 |
{ |
{ |
517 |
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); |
518 |
|
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))) |
521 |
|
{ |
522 |
|
using (log4net.NDC.Push("Key is missing")) |
523 |
|
{ |
524 |
|
Logging.ATSAdminLog.Error("Error when writing to registry."); |
525 |
|
} |
526 |
|
} |
527 |
|
} |
528 |
Application.Exit(); |
Application.Exit(); |
529 |
} |
} |
530 |
} |
} |
541 |
catch (ArgumentNullException) |
catch (ArgumentNullException) |
542 |
{ |
{ |
543 |
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)"); |
544 |
|
using (log4net.NDC.Push(string.Format("SqlException: MESSAGE={0}{1}Diagnostics:{1}{2}", e.Message, System.Environment.NewLine, e.ToString()))) |
545 |
|
{ |
546 |
|
using (log4net.NDC.Push(string.Format("key={0} value={1}", regKey, regValue))) |
547 |
|
{ |
548 |
|
using (log4net.NDC.Push("Installation info missing")) |
549 |
|
{ |
550 |
|
Logging.ATSAdminLog.Error("Error when reading from registry."); |
551 |
|
} |
552 |
|
} |
553 |
|
} |
554 |
Application.Exit(); |
Application.Exit(); |
555 |
return false; |
return false; |
556 |
} |
} |
557 |
catch (SecurityException e) |
catch (SecurityException e) |
558 |
{ |
{ |
559 |
MessageBox.Show("Error when reading from registry. You do not have the necessary permission (29412). Key: " + regKey + " Value: " + regValue + " Error details:" + e.Message); |
MessageBox.Show("Error when reading from registry. You do not have the necessary permission (29412). Key: " + regKey + " Value: " + regValue + " Error details:" + e.Message); |
560 |
|
using (log4net.NDC.Push(string.Format("SqlException: MESSAGE={0}{1}Diagnostics:{1}{2}", e.Message, System.Environment.NewLine, e.ToString()))) |
561 |
|
{ |
562 |
|
using (log4net.NDC.Push(string.Format("key={0} value={1}", regKey, regValue))) |
563 |
|
{ |
564 |
|
using (log4net.NDC.Push("Invalid user rights")) |
565 |
|
{ |
566 |
|
Logging.ATSAdminLog.Error("Error when reading from registry."); |
567 |
|
} |
568 |
|
} |
569 |
|
} |
570 |
Application.Exit(); |
Application.Exit(); |
571 |
return false; |
return false; |
572 |
} |
} |
573 |
catch (Exception e) |
catch (Exception e) |
574 |
{ |
{ |
575 |
MessageBox.Show("Error when reading from registry (29413). Key: " + regKey + " Value: " + regValue + " Error details:" + e.Message); |
MessageBox.Show("Error when reading from registry (29413). Key: " + regKey + " Value: " + regValue + " Error details:" + e.Message); |
576 |
|
using (log4net.NDC.Push(string.Format("SqlException: MESSAGE={0}{1}Diagnostics:{1}{2}", e.Message, System.Environment.NewLine, e.ToString()))) |
577 |
|
{ |
578 |
|
using (log4net.NDC.Push(string.Format("key={0} value={1}", regKey, regValue))) |
579 |
|
{ |
580 |
|
Logging.ATSAdminLog.Error("Error when reading from registry."); |
581 |
|
} |
582 |
|
} |
583 |
Application.Exit(); |
Application.Exit(); |
584 |
return false; |
return false; |
585 |
} |
} |
598 |
else |
else |
599 |
{ |
{ |
600 |
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); |
601 |
|
using (log4net.NDC.Push(string.Format("SqlException: MESSAGE={0}{1}Diagnostics:{1}{2}", e.Message, System.Environment.NewLine, e.ToString()))) |
602 |
|
{ |
603 |
|
using (log4net.NDC.Push(string.Format("key={0} value={1}", regKey, regValue))) |
604 |
|
{ |
605 |
|
using (log4net.NDC.Push("Key is missing")) |
606 |
|
{ |
607 |
|
Logging.ATSAdminLog.Error("Error when reading from registry."); |
608 |
|
} |
609 |
|
} |
610 |
|
} |
611 |
Application.Exit(); |
Application.Exit(); |
612 |
} |
} |
613 |
return false; // No value could be retrieved from registry |
return false; // No value could be retrieved from registry |
722 |
{ |
{ |
723 |
objRegkey = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(regKey); |
objRegkey = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(regKey); |
724 |
} |
} |
725 |
catch (ArgumentNullException) |
catch (ArgumentNullException e) |
726 |
{ |
{ |
727 |
MessageBox.Show("Error when reading from registry. Installation info missing, please run the " + ATSGlobals.ApplicationName + " installation program. (92411)"); |
MessageBox.Show("Error when reading from registry. Installation info missing, please run the " + ATSGlobals.ApplicationName + " installation program. (92411)"); |
728 |
|
using (log4net.NDC.Push(string.Format("SqlException: MESSAGE={0}{1}Diagnostics:{1}{2}", e.Message, System.Environment.NewLine, e.ToString()))) |
729 |
|
{ |
730 |
|
using (log4net.NDC.Push(string.Format("key={0} value={1}", regKey, regValue))) |
731 |
|
{ |
732 |
|
using (log4net.NDC.Push("Installation info missing")) |
733 |
|
{ |
734 |
|
Logging.ATSAdminLog.Error("Error when reading from registry."); |
735 |
|
} |
736 |
|
} |
737 |
|
} |
738 |
Application.Exit(); |
Application.Exit(); |
739 |
return; |
return; |
740 |
} |
} |
741 |
catch (SecurityException e) |
catch (SecurityException e) |
742 |
{ |
{ |
743 |
MessageBox.Show("Error when reading from registry. You do not have the necessary permission (92412). Key: "+ regKey + " Value: " + regValue + " Error details:" + e.Message); |
MessageBox.Show("Error when reading from registry. You do not have the necessary permission (92412). Key: "+ regKey + " Value: " + regValue + " Error details:" + e.Message); |
744 |
|
using (log4net.NDC.Push(string.Format("SqlException: MESSAGE={0}{1}Diagnostics:{1}{2}", e.Message, System.Environment.NewLine, e.ToString()))) |
745 |
|
{ |
746 |
|
using (log4net.NDC.Push(string.Format("key={0} value={1}", regKey, regValue))) |
747 |
|
{ |
748 |
|
using (log4net.NDC.Push("Invalid user rights")) |
749 |
|
{ |
750 |
|
Logging.ATSAdminLog.Error("Error when reading from registry."); |
751 |
|
} |
752 |
|
} |
753 |
|
} |
754 |
Application.Exit(); |
Application.Exit(); |
755 |
return; |
return; |
756 |
} |
} |
757 |
catch (Exception e) |
catch (Exception e) |
758 |
{ |
{ |
759 |
MessageBox.Show("Error when reading from registry (92413). Key: " + regKey + " Value: " + regValue + " Error details:" + e.Message); |
MessageBox.Show("Error when reading from registry (92413). Key: " + regKey + " Value: " + regValue + " Error details:" + e.Message); |
760 |
|
using (log4net.NDC.Push(string.Format("SqlException: MESSAGE={0}{1}Diagnostics:{1}{2}", e.Message, System.Environment.NewLine, e.ToString()))) |
761 |
|
{ |
762 |
|
using (log4net.NDC.Push(string.Format("key={0} value={1}", regKey, regValue))) |
763 |
|
{ |
764 |
|
Logging.ATSAdminLog.Error("Error when reading from registry."); |
765 |
|
|
766 |
|
} |
767 |
|
} |
768 |
Application.Exit(); |
Application.Exit(); |
769 |
return; |
return; |
770 |
} |
} |
779 |
else |
else |
780 |
{ |
{ |
781 |
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); |
782 |
|
using (log4net.NDC.Push(string.Format("SqlException: MESSAGE={0}{1}Diagnostics:{1}{2}", e.Message, System.Environment.NewLine, e.ToString()))) |
783 |
|
{ |
784 |
|
using (log4net.NDC.Push(string.Format("key={0} value={1}", regKey, regValue))) |
785 |
|
{ |
786 |
|
Logging.ATSAdminLog.Error("Error when reading from registry."); |
787 |
|
} |
788 |
|
} |
789 |
Application.Exit(); |
Application.Exit(); |
790 |
} |
} |
791 |
} |
} |
801 |
{ |
{ |
802 |
objRegkey = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(regKey); |
objRegkey = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(regKey); |
803 |
} |
} |
804 |
catch (ArgumentNullException) |
catch (ArgumentNullException e) |
805 |
{ |
{ |
806 |
MessageBox.Show("Error when reading from registry. Installation info missing, please run the " + ATSGlobals.ApplicationName + " installation program. (92411)"); |
MessageBox.Show("Error when reading from registry. Installation info missing, please run the " + ATSGlobals.ApplicationName + " installation program. (92411)"); |
807 |
|
using (log4net.NDC.Push(string.Format("SqlException: MESSAGE={0}{1}Diagnostics:{1}{2}", e.Message, System.Environment.NewLine, e.ToString()))) |
808 |
|
{ |
809 |
|
using (log4net.NDC.Push(string.Format("key={0} value={1}", regKey, regValue))) |
810 |
|
{ |
811 |
|
using (log4net.NDC.Push("Installation info missing")) |
812 |
|
{ |
813 |
|
Logging.ATSAdminLog.Error("Error when reading from registry."); |
814 |
|
} |
815 |
|
} |
816 |
|
} |
817 |
Application.Exit(); |
Application.Exit(); |
818 |
return; |
return; |
819 |
} |
} |
820 |
catch (SecurityException e) |
catch (SecurityException e) |
821 |
{ |
{ |
822 |
MessageBox.Show("Error when reading from registry. You do not have the necessary permission (92412). Key: " + regKey + " Value: " + regValue + " Error details:" + e.Message); |
MessageBox.Show("Error when reading from registry. You do not have the necessary permission (92412). Key: " + regKey + " Value: " + regValue + " Error details:" + e.Message); |
823 |
|
using (log4net.NDC.Push(string.Format("SqlException: MESSAGE={0}{1}Diagnostics:{1}{2}", e.Message, System.Environment.NewLine, e.ToString()))) |
824 |
|
{ |
825 |
|
using (log4net.NDC.Push(string.Format("key={0} value={1}", regKey, regValue))) |
826 |
|
{ |
827 |
|
using (log4net.NDC.Push("Invalid users rights")) |
828 |
|
{ |
829 |
|
Logging.ATSAdminLog.Error("Error when reading from registry."); |
830 |
|
} |
831 |
|
} |
832 |
|
} |
833 |
Application.Exit(); |
Application.Exit(); |
834 |
return; |
return; |
835 |
} |
} |
836 |
catch (Exception e) |
catch (Exception e) |
837 |
{ |
{ |
838 |
MessageBox.Show("Error when reading from registry (92413). Key: " + regKey + " Value: " + regValue + " Error details:" + e.Message); |
MessageBox.Show("Error when reading from registry (92413). Key: " + regKey + " Value: " + regValue + " Error details:" + e.Message); |
839 |
|
using (log4net.NDC.Push(string.Format("SqlException: MESSAGE={0}{1}Diagnostics:{1}{2}", e.Message, System.Environment.NewLine, e.ToString()))) |
840 |
|
{ |
841 |
|
using (log4net.NDC.Push(string.Format("key={0} value={1}", regKey, regValue))) |
842 |
|
{ |
843 |
|
Logging.ATSAdminLog.Error("Error when reading from registry."); |
844 |
|
} |
845 |
|
} |
846 |
Application.Exit(); |
Application.Exit(); |
847 |
return; |
return; |
848 |
} |
} |
857 |
else |
else |
858 |
{ |
{ |
859 |
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); |
860 |
|
using (log4net.NDC.Push(string.Format("SqlException: MESSAGE={0}{1}Diagnostics:{1}{2}", e.Message, System.Environment.NewLine, e.ToString()))) |
861 |
|
{ |
862 |
|
using (log4net.NDC.Push(string.Format("key={0} value={1}", regKey, regValue))) |
863 |
|
{ |
864 |
|
Logging.ATSAdminLog.Error("Error when reading from registry."); |
865 |
|
} |
866 |
|
} |
867 |
Application.Exit(); |
Application.Exit(); |
868 |
} |
} |
869 |
} |
} |