From: Fabrice Foray on
Hi,
I would like to develop an application around DHCP Api.
I've seen the MSDN doc about DHCP Server Management API and that's
exactly what I'm looking for :
Create, modify, and delete client leases, view DHCP subnets/scopes,
create/delete reservations

But all this is for C++ and I would like to use C#.
I've found the old dhcpobjs COM, but I can't register it, and would
prefer a solution using DllImport and structure declaration.
So I've take a look at pinvoke.net but I can't really find a easy-to-
use set of classes

Can someone help me ?

Thx,
Fabrice
From: Peter Duniho on
Fabrice Foray wrote:
> Hi,
> I would like to develop an application around DHCP Api.
> I've seen the MSDN doc about DHCP Server Management API and that's
> exactly what I'm looking for :
> Create, modify, and delete client leases, view DHCP subnets/scopes,
> create/delete reservations
>
> But all this is for C++ and I would like to use C#.
> I've found the old dhcpobjs COM, but I can't register it, and would
> prefer a solution using DllImport and structure declaration.
> So I've take a look at pinvoke.net but I can't really find a easy-to-
> use set of classes
>
> Can someone help me ?

Have you looked at the WMI API? .NET has support for it, and I think
it's possible the DHCP stuff may be included in WMI. That would be a
better approach than trying to p/invoke to the native API.

If WMI doesn't support DHCP management and you're stuck doing p/invoke,
then unfortunately your question isn't specific enough to be answered
other than someone just writing a library for you or finding one for you
with Google.

If there's a good library for DHCP management on Windows, I'm sure
Google knows about it. If you can't find it with Google, you will
probably have to write it yourself.

If you have specific p/invoke questions, please feel free to ask them
here or in the interop newsgroup (they are more on-topic in the interop
newsgroup, but there are at least a couple of other people here who know
p/invoke pretty well).

Pete