File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ using System ;
2+
3+ /*
4+ * The default WMI method class includes:
5+ * 1. CriticalException.cs - A custom exception class for critical WMI errors
6+ * 2. CommonException.cs - A custom exception class for common WMI errors
7+ * 3. MachineMethods.cs - A base class for WMI operations on local and remote machines
8+ */
9+ namespace GetWMIBasic . WMIMethods
10+ {
11+ /*
12+ * Common Exception class
13+ * It is used to test common exceptions in WMI operations
14+ */
15+ public class CommonException : SystemException
16+ {
17+ // Default constructor - No custom message (use default message)
18+ public CommonException ( )
19+ {
20+ // Throw a new exception with a default message
21+ throw new Exception ( "This is a custom exception for WMI-related errors." ) ;
22+ }
23+
24+ // Default constructor - with custom message
25+ public CommonException ( string message ) : base ( message )
26+ {
27+ // Throw a new exception with custom message
28+ throw new Exception ( message ) ;
29+ }
30+ }
31+ }
Original file line number Diff line number Diff line change 1+ using System ;
2+
3+ /*
4+ * The default WMI method class includes:
5+ * 1. CriticalException.cs - A custom exception class for critical WMI errors
6+ * 2. CommonException.cs - A custom exception class for common WMI errors
7+ * 3. MachineMethods.cs - A base class for WMI operations on local and remote machines
8+ */
9+ namespace GetWMIBasic . WMIMethods
10+ {
11+ /*
12+ * Critical Exception class
13+ * It is used to test critical exceptions in WMI operations
14+ */
15+ public class CriticalException : SystemException
16+ {
17+ // Default constructor - No custom message (use default message)
18+ public CriticalException ( )
19+ {
20+ // Throw a new exception with a default message
21+ throw new Exception ( "A critical exception has occurred in the WMI operations." ) ;
22+ }
23+
24+ // Default constructor - with custom message
25+ public CriticalException ( string message ) : base ( message )
26+ {
27+ // Throw a new exception with custom message
28+ throw new Exception ( message ) ;
29+ }
30+ }
31+ }
You can’t perform that action at this time.
0 commit comments