Example #1
0
        public static int Main(string[] args)
        {
            ManagementPath path = new ManagementPath("\\\\products1\\root\\cimv2:Win32_Something.A=10,B='haha'");

            Console.WriteLine(path.ToString());
            Console.WriteLine("Path[" + path.Path + "]");
            Console.WriteLine("Server[" + path.Server + "]");
            Console.WriteLine("ClassName[" + path.ClassName + "]");
            Console.WriteLine("RelativePath[" + path.RelativePath + "]");
            Console.WriteLine("NamespacePath[" + path.NamespacePath + "]");

            ManagementPath path2 = new ManagementPath();

            path2.ClassName = "Fred";
            Console.WriteLine("Path[" + path2.Path + "]");
            path2.SetAsSingletion();
            Console.WriteLine("Path[" + path2.Path + "]");

            path2.SetAsClass();
            Console.WriteLine("Path[" + path2.Path + "]");

            return(0);
        }