Desktop Functions: Smart Device Functions:
|
C# Signature:
[DllImport("iphlpapi.dll", ExactSpelling=true)] VB Signature:
Declare Function SendARP Lib "iphlpapi.dll" ( User-Defined Types:None. Notes:SendARP returns 0 on success. The parameter SrcIP can be 0. Tips & Tricks:Please add some! The DestIP and SrcIP arguments should be UInt32 to avoid System.OverflowException when the last nibble of the IP-address is .128 or greater. Sample Code:This code help to get the MAC Address of a network card (You need to know the IP address)
Public Shared Function GetMAC(ByVal IPAddress As String) As String This is a similar C# sample
IPAddress dst = IPAddress.Parse("192.168.2.1"); // the destination IP address Note:Can Someone give the code to get the IP address of the server //Please do not use the IPAddress.Address property //This API is now obsolete. --> http://msdn.microsoft.com/en-us/library/system.net.ipaddress.address.aspx //to get the IP in Integer mode use int intAddress = BitConverter.ToInt32(dst.GetAddressBytes(), 0);
byte[] macAddr = new byte[6]; Alternative Managed API:Do you know one? Please contribute it! Please edit this page!Do you have...
Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).
|
|