[StructLayout(LayoutKind.Sequential)]
private struct MXRecord
{
public IntPtr pNext;
public string pName;
public short wType;
public short wDataLength;
public int flags;
public int dwTtl;
public int dwReserved;
public IntPtr pNameExchange;
public short wPreference;
public short Pad;
}
}
}
[/code:b9fa7c191f]
调用的例子
[code:b9fa7c191f]
static void Main(string[] args)
{
string[] s= PAB.DnsUtils.DnsMx.GetMXRecords("microsoft.com");
foreach (string st in s)
Console.WriteLine("Server: {0}",st);
Console.ReadLine(); [/code:b9fa7c191f]