Metah - A Web Technologist Adventure

Tweets

Archive for October, 2008

WMI and CSharp (C#):
Enumerate all classes from a namespace

October 29th, 2008 at 10:57 pm by Ahmet Gyger

Tags: , , , , ,
Posted in CSharp, Microsoft, Tutorials



Now that we know how to enumerate all the namespace from root, let’s have a look on how to enumerate all the classes from a namespace.

using System;
using System.Collections.Generic;
using System.Text;
using System.Management;

namespace WmiNamespace
{
class Program
{
static void Main(string[] args)
[...]

WMI and CSharp (C#):
Enumerate all Namespaces from Root

October 28th, 2008 at 11:29 pm by Ahmet Gyger

Tags: , , ,
Posted in CSharp, Microsoft, Tutorials



I like to understand WMI (Windows Management Instrumentation) as a database, main concepts are:
Namespaces: Databases
Classes: Tables
Properties: Columns
Instances: Lines
Values: Fields
With this in mind, we can start enumerating all the namespaces we can access locally.

using System;
using System.Collections.Generic;
using System.Text;
using System.Management;

namespace WmiNamespace
{
class Program
{
static [...]