Is there any sample code for making a DHCP reservation via C#?
Thanks in advance 5 4744
KarlM,
You can use WMI for this. Using the classes in the System.Management
namespace, you can get the instance of the Win32_NetworkAdapterConfiguration
instance which corresponds to the network adapter that you want to make the
DHCP lease for. You can then call the ReleaseDHCPLease method and the
RenewDHCPLease methods to release and renew the DHCP lease.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"KarlM" <Ma******@newsgroup.nospam> wrote in message
news:ED**********************************@microsof t.com... Is there any sample code for making a DHCP reservation via C#?
Thanks in advance
Hmm, it just occurs to me now, you are trying to make a reservation on
the DHCP server, right?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"KarlM" <Ma******@newsgroup.nospam> wrote in message
news:ED**********************************@microsof t.com... Is there any sample code for making a DHCP reservation via C#?
Thanks in advance
Yes, that's right.
"Nicholas Paldino [.NET/C# MVP]" wrote: Hmm, it just occurs to me now, you are trying to make a reservation on the DHCP server, right?
-- - Nicholas Paldino [.NET/C# MVP] - mv*@spam.guard.caspershouse.com
"KarlM" <Ma******@newsgroup.nospam> wrote in message news:ED**********************************@microsof t.com... Is there any sample code for making a DHCP reservation via C#?
Thanks in advance
Hi Martin,
Welcome to MSDN Newsgroup!
I agreed with Nicholas's point here. WMI is a good solution for issue. I
suggest you can try it first.
If there is any problem and concern, please feel free to let me know. I am
glad to provide further support. Thanks!
Best Regards,
Terry Fei[MSFT]
Microsoft Community Support
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
-------------------- Thread-Topic: DHCP reservation thread-index: AcZHPeotv2STz4lhRRmCVoD08Bz22w== X-WBNR-Posting-Host: 82.141.45.146 From: =?Utf-8?B?S2FybE0=?= <Ma******@newsgroup.nospam> References: <ED**********************************@microsoft.co m>
<u2**************@tk2msftngp13.phx.gbl>Subject: Re: DHCP reservation Date: Tue, 14 Mar 2006 00:04:27 -0800 Lines: 20 Message-ID: <81**********************************@microsoft.co m> MIME-Version: 1.0 Content-Type: text/plain; charset="Utf-8" Content-Transfer-Encoding: 7bit X-Newsreader: Microsoft CDO for Windows 2000 Content-Class: urn:content-classes:message Importance: normal Priority: normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.1830 Newsgroups: microsoft.public.dotnet.languages.csharp Path: TK2MSFTNGXA03.phx.gbl Xref: TK2MSFTNGXA03.phx.gbl microsoft.public.dotnet.languages.csharp:391968 NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250 X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
Yes, that's right.
"Nicholas Paldino [.NET/C# MVP]" wrote:
Hmm, it just occurs to me now, you are trying to make a reservation
on the DHCP server, right?
-- - Nicholas Paldino [.NET/C# MVP] - mv*@spam.guard.caspershouse.com
"KarlM" <Ma******@newsgroup.nospam> wrote in message news:ED**********************************@microsof t.com... > Is there any sample code for making a DHCP reservation via C#? > > Thanks in advance
Thank you Terry. I can try that too.
""TerryFei"" wrote: Hi Martin, Welcome to MSDN Newsgroup!
I agreed with Nicholas's point here. WMI is a good solution for issue. I suggest you can try it first. If there is any problem and concern, please feel free to let me know. I am glad to provide further support. Thanks!
Best Regards,
Terry Fei[MSFT] Microsoft Community Support Get Secure! www.microsoft.com/security (This posting is provided "AS IS", with no warranties, and confers no rights.)
--------------------Thread-Topic: DHCP reservation thread-index: AcZHPeotv2STz4lhRRmCVoD08Bz22w== X-WBNR-Posting-Host: 82.141.45.146 From: =?Utf-8?B?S2FybE0=?= <Ma******@newsgroup.nospam> References: <ED**********************************@microsoft.co m> <u2**************@tk2msftngp13.phx.gbl>Subject: Re: DHCP reservation Date: Tue, 14 Mar 2006 00:04:27 -0800 Lines: 20 Message-ID: <81**********************************@microsoft.co m> MIME-Version: 1.0 Content-Type: text/plain; charset="Utf-8" Content-Transfer-Encoding: 7bit X-Newsreader: Microsoft CDO for Windows 2000 Content-Class: urn:content-classes:message Importance: normal Priority: normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.1830 Newsgroups: microsoft.public.dotnet.languages.csharp Path: TK2MSFTNGXA03.phx.gbl Xref: TK2MSFTNGXA03.phx.gbl microsoft.public.dotnet.languages.csharp:391968 NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250 X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
Yes, that's right.
"Nicholas Paldino [.NET/C# MVP]" wrote:
Hmm, it just occurs to me now, you are trying to make a reservation on the DHCP server, right?
-- - Nicholas Paldino [.NET/C# MVP] - mv*@spam.guard.caspershouse.com
"KarlM" <Ma******@newsgroup.nospam> wrote in message news:ED**********************************@microsof t.com... > Is there any sample code for making a DHCP reservation via C#? > > Thanks in advance
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Leszek Gruszka |
last post by:
How to get static IP adresses from DHCP?
I haven't seen it anywhere... :(
|
by: Steve |
last post by:
Hi Folks, I'm trying to create a c# class to manage a DHCP subnet using
the win api (dhcpsapi.dll). Currently I can't even instanciate my
class, instead I receive the error:...
|
by: WhatHappend |
last post by:
I have converted a .Net 1.0 application to .Net 2.0 and the web service
invocations have delay of around 10seconds on each intial access. After the
first access subsequent access are fast (After a...
|
by: Richard |
last post by:
Hello,
I'm working on an application to allow our network team to use a small
application to make DHCP reservations on our Microsoft DHCP Server.
The problem is you have to use P/Invoke to do...
|
by: GHUM |
last post by:
Hello,
I need to get a list of active leases on a windows dhcp server.
Experts from Microsoft statet:
""""
A: Go to the Address leases of each scope in the DHCP snap-in and dump
the leases...
|
by: Screenbert |
last post by:
After finding nothing anywhere in google I am posting this so everyone
can benefit by it. The formating is not pretty since I copied it from
my word document, but you should benefit by it.
...
|
by: screenbert |
last post by:
Managing DHCP Servers using C#
They said it was impossible. It couldn't be done. But you can in fact
manage DHCP servers using C#. This includes creating and deleting
Scopes, SuperScopes,...
|
by: =?Utf-8?B?Sm9ubnlCZWU=?= |
last post by:
Hello,
I would like to be able to make DHCP reservations on the server using .NET.
After a search, I saw little on the subject, but there was a hint that it
could be done via WMI. I've looked,...
|
by: =?Utf-8?B?bHVrYXN6amc=?= |
last post by:
I'm using dhcp (windows 2003 SP1) on our DC. In dhcp all adresses are
excluded we only using reservations. Our routers and switches (cisco and
3com) do not obtain addresses from reservation but PC...
|
by: MeoLessi9 |
last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
|
by: DolphinDB |
last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation.
Take...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: Aftab Ahmad |
last post by:
Hello Experts!
I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
|
by: Aftab Ahmad |
last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below.
Dim IE As Object
Set IE =...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: marcoviolo |
last post by:
Dear all,
I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
| |