C# Problem

  • Thread starter Reinhard Achleitner
  • Start date
R

Reinhard Achleitner

Hi!

I'm a beginner in creating embedded images, but after one week work, i'm
getting in :)

But there is a problem i can't solve yet. I want to get the mac address with
c# on the machine. .net 1.1 is installed, but following code hangs at foreach:

ManagementClass oMClass = new ManagementClass
("Win32_NetworkAdapterConfiguration");

ManagementObjectCollection colMObj = oMClass.GetInstances();
foreach(ManagementObject objMO in colMObj)
{
MessageBox.Show(objMO["MacAddress"].ToString());
}

The same code works well on my developing machine, but not on the XP Embedded.
Have i forgotten a component?

kind regards

Reinhard
 
K

KM

And WMI Network Provider.

--
=========
Regards,
KM
I'm no expert either, but make sure you have WMI components added to your
image.

--
<a href="http://www.sochi-travel.info/">My Sochi Blog</a>



Reinhard Achleitner said:
Hi!

I'm a beginner in creating embedded images, but after one week work, i'm
getting in :)

But there is a problem i can't solve yet. I want to get the mac address with
c# on the machine. .net 1.1 is installed, but following code hangs at foreach:

ManagementClass oMClass = new ManagementClass
("Win32_NetworkAdapterConfiguration");

ManagementObjectCollection colMObj = oMClass.GetInstances();
foreach(ManagementObject objMO in colMObj)
{
MessageBox.Show(objMO["MacAddress"].ToString());
}

The same code works well on my developing machine, but not on the XP Embedded.
Have i forgotten a component?

kind regards

Reinhard
 
R

Reinhard Achleitner

Hi!

Thx for your help, i added the WMI components and it works now..

kind regards
Reinhard

KM said:
And WMI Network Provider.

--
=========
Regards,
KM
I'm no expert either, but make sure you have WMI components added to your
image.

--
<a href="http://www.sochi-travel.info/">My Sochi Blog</a>



Reinhard Achleitner said:
Hi!

I'm a beginner in creating embedded images, but after one week work, i'm
getting in :)

But there is a problem i can't solve yet. I want to get the mac address
with
c# on the machine. .net 1.1 is installed, but following code hangs at
foreach:

ManagementClass oMClass = new ManagementClass
("Win32_NetworkAdapterConfiguration");

ManagementObjectCollection colMObj = oMClass.GetInstances();
foreach(ManagementObject objMO in colMObj)
{
MessageBox.Show(objMO["MacAddress"].ToString());
}

The same code works well on my developing machine, but not on the XP
Embedded.
Have i forgotten a component?

kind regards

Reinhard
 
R

Reinhard Achleitner

Hi!

Thx for your help, i added the WMI components and it works now..

kind regards
Reinhard

KM said:
And WMI Network Provider.

--
=========
Regards,
KM
I'm no expert either, but make sure you have WMI components added to your
image.

--
<a href="http://www.sochi-travel.info/">My Sochi Blog</a>



Reinhard Achleitner said:
Hi!

I'm a beginner in creating embedded images, but after one week work, i'm
getting in :)

But there is a problem i can't solve yet. I want to get the mac address
with
c# on the machine. .net 1.1 is installed, but following code hangs at
foreach:

ManagementClass oMClass = new ManagementClass
("Win32_NetworkAdapterConfiguration");

ManagementObjectCollection colMObj = oMClass.GetInstances();
foreach(ManagementObject objMO in colMObj)
{
MessageBox.Show(objMO["MacAddress"].ToString());
}

The same code works well on my developing machine, but not on the XP
Embedded.
Have i forgotten a component?

kind regards

Reinhard
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top