Click here to Skip to main content
15,938,325 members
Home / Discussions / C#
   

C#

 
GeneralRe: I would like to create a button that allow to open html page. Pin
TigerNinja_31-Jan-03 5:09
TigerNinja_31-Jan-03 5:09 
GeneralRe: I would like to create a button that allow to open html page. Pin
zoltix31-Jan-03 5:30
zoltix31-Jan-03 5:30 
GeneralRe: I would like to create a button that allow to open html page. Pin
Anonymous31-Jan-03 19:52
Anonymous31-Jan-03 19:52 
Questionis machine.config cached ??? Pin
Dato31-Jan-03 2:48
Dato31-Jan-03 2:48 
GeneralReusing closed/disposed forms Pin
31-Jan-03 0:58
suss31-Jan-03 0:58 
GeneralRe: Reusing closed/disposed forms Pin
leppie31-Jan-03 4:18
leppie31-Jan-03 4:18 
GeneralExcel automation Pin
Mauricio Ritter30-Jan-03 23:49
Mauricio Ritter30-Jan-03 23:49 
GeneralCan't get MAC address using ManagementClass Pin
EnkelIk30-Jan-03 21:15
EnkelIk30-Jan-03 21:15 
I've written a small app that retrieves the MAC-address from computors, using ManagementClass, ManagementObjectCollection and so on, eventually ManagementBaseObject.get_Item("MacAddress"); which turns out to work fine for most computors. Lately however I have discovered that for some computors a different series of numbers is retrieved. Looking into it a bit deeper I found that on all computors not one, but serveral items could be found calling get_item("MacAddress"). So my program did work for computors where the real MACaddress was the first to be returned (and apparently this included most computers).

Have I missed something? How can I tell which one is the real MAC address, and what are the other numbers?

Kind regards
/EnkelIk

Below a snippet of my code:
ManagementClass mc;
ManagementObjectCollection moc;
ManagementBaseObject mbo;
ManagementObjectCollection.ManagementObjectEnumerator moe;
string strMAC="",strTmp;

mc = new ManagementClass("Win32_NetworkAdapterConfiguration");
moc = mc.GetInstances(); // Get network adapter instance

moe=moc.GetEnumerator();

//Loop till MAC address found
while(moe.MoveNext())
{
mbo=moe.Current;

if(mbo["IPEnabled"]!=null)
{
Object pObj;

//Get MAC address
pObj=mbo["MacAddress"];
if(pObj!=null)
{
strTmp=pObj.ToString();
strMAC=string.Concat(strMAC,strTmp);

//Remove colon
strMAC=strMAC.Replace(":","");
break;
}
}
}

GeneralRe: Can't get MAC address using ManagementClass Pin
EnkelIk4-Feb-03 23:11
EnkelIk4-Feb-03 23:11 
GeneralSystemMenu Pin
ShulapovMax30-Jan-03 20:50
ShulapovMax30-Jan-03 20:50 
GeneralRe: SystemMenu Pin
Roger Alsing31-Jan-03 1:03
Roger Alsing31-Jan-03 1:03 
QuestionCursor Change while UserControl Drag And Drop ? Pin
Paresh Gheewala30-Jan-03 15:43
Paresh Gheewala30-Jan-03 15:43 
AnswerRe: Cursor Change while UserControl Drag And Drop ? Pin
Paresh Gheewala31-Jan-03 10:56
Paresh Gheewala31-Jan-03 10:56 
QuestionHow do I get a file's REAL last modified date? Pin
lnong30-Jan-03 13:34
lnong30-Jan-03 13:34 
AnswerRe: How do I get a file's REAL last modified date? Pin
Todd Smith30-Jan-03 14:17
Todd Smith30-Jan-03 14:17 
GeneralPanel Repaint Pin
sv787430-Jan-03 12:25
sv787430-Jan-03 12:25 
GeneralRe: Panel Repaint Pin
Nick Parker30-Jan-03 16:02
protectorNick Parker30-Jan-03 16:02 
QuestionOwnerdraw context menu in traybar? Pin
anewmachine30-Jan-03 12:23
anewmachine30-Jan-03 12:23 
GeneralentryPoint of a PE file Pin
blacksun_damn30-Jan-03 11:52
blacksun_damn30-Jan-03 11:52 
GeneralSystem.Diagnostics Pin
jtmtv1830-Jan-03 11:49
jtmtv1830-Jan-03 11:49 
GeneralRe: System.Diagnostics Pin
Vasudevan Deepak Kumar30-Jan-03 17:29
Vasudevan Deepak Kumar30-Jan-03 17:29 
GeneralRe: System.Diagnostics Pin
jtmtv1830-Jan-03 17:57
jtmtv1830-Jan-03 17:57 
GeneralTextBox.Clear() Method Pin
Member 14906930-Jan-03 9:06
Member 14906930-Jan-03 9:06 
GeneralRe: TextBox.Clear() Method Pin
leppie30-Jan-03 10:04
leppie30-Jan-03 10:04 
GeneralRe: TextBox.Clear() Method Pin
Member 14906930-Jan-03 10:40
Member 14906930-Jan-03 10:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.