SDK Resources > C# CIM Framework API > "Not Typed" Example

"Not Typed" Example

This example performs the same function as the strong typing example.

Untyped functions require text versions of the class name, field names, and field values. Further, the CimObject returns text field names and values.

The generated classes know the resource URI for the class. The untyped functions require supplying the URI explicitly.

// Define resourceUri of the object to receive

Uri resourceUri = new Uri("");

The example requests an Enumerate of the class identified in the URI. This request will return not only all instances of CIM_PhysicalMemory, but any objects that inherit from CIM_PhysicalMemory. In this way it is possible to retrieve information without knowing the name of the inheriting objects.

// Receive all object with the required resourceUri

List<CimObject> physicalMemoryList = CimObject.Enumerate(wsmanClient, resourceUri);


int itemIndex = 0;

// Loop over all the objects.

foreach (CimObject mem in physicalMemoryList)


    string res = String.Empty;

    List<KeyValuePair<string, string>> properties = mem.Properties;

    foreach (KeyValuePair<string, string> property in properties)


        res += property.Key + ": " + property.Value + "\n";


    // Print the values of each CIM_PhysicalMemory

    Console.WriteLine("\n Item #{0}", itemIndex);






Copyright © 2006-2022, Intel Corporation. All rights reserved.