Best way to get MX record from C#

C

C.Levasseur

Hi, I would like to know what's the best way to get a DNS MX record from C#.
The Win32 DnsQuery() API seams to do the job but is there a C# (.Net
framework) equivalent? If not, is P/Invoke my only solution? I'm not that
familiar with P/Invoke... and DnsQuery has a lot of structures (in C). If
P/Invoke is my only solution, is there a tool that can generate the C#
(structures, static method, etc.). If no such tool exists, does someone have
an example of how to invoke DnsQuery using P/Invoke in C#? Is it simpler to
use a COM object?

Thank you for your help.

C. Levasseur
 

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