Home > Net > ManagementObject ManagementBaseObject and what is the difference between these two classes?
ManagementObject ManagementBaseObject and what is the difference between these two classes?
Time:10-01
Didn't feel what is the difference between when using, as shown in the following code:
static int Main (string [] args) { ManagementClass diskClass= New ManagementClass (" Win32_LogicalDisk "); ManagementObjectCollection disks= DiskClass. GetInstances (); ManagementObjectCollection. ManagementObjectEnumerator DisksEnumerator= Disks. GetEnumerator (); While (disksEnumerator. MoveNext ()) { ManagementObject disk=(ManagementObject) disksEnumerator. Current; //ManagementBaseObject disk=disksEnumerator. Current;//this can also be ah, why do they go? Console. WriteLine ( "Disk found:" + Disk (" deviceid ")); } return 0; }
CodePudding user response:
The name will know that the latter is the base class of the former, what's the difference between the base class and derived class? What's the difference between you and your dad?