views:

197

answers:

2
+2  Q: 

MAC address

public static NDIS_802_3_ADDRESS StrToByteArray(string str)
        {
            ASCIIEncoding encoding = new ASCIIEncoding();
            byte[] m = encoding.GetBytes(str);
            NDIS_802_3_ADDRESS mac = new NDIS_802_3_ADDRESS(m);
            return mac;
        }

You use these method in order to change string to mac address, however the output of that is fixed value 30-30-2D-32-31-2D, whatever the input string.

Any ideas?

A: 

The question is what does NDIS_802_3_ADDRESS does with byte array it receives? And where did you get it? It is a custom class/struct so you should tell us where you got it or what should it do.

Alex Reitbort
+5  A: 

It's probably returning the MAC address for your network interface card.

If you're on windows, from the command line run ipconfig /all. Does that match the value you are being returned?

I'm not really sure what this method is supposed to do in the first place. What are you passing in as the input string and what do you expect this method to do?

blak3r