dhcp Info in vb.net 
Author Message
 dhcp Info in vb.net

Is there a way of accessin the dhcp info in vb.net.
i want to get which computer has been assigned which ip
address.

Can this be done?

Thanks

Roland



Tue, 26 Apr 2005 20:53:01 GMT  
 dhcp Info in vb.net
I can think of about three but I'll keep it to one. Add a reference to
Windows Management.

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

        'this is entirely new syntax for wmi
        'instead of having to dim a locator and services object, we call the
managementobjectsearcher
        'totally cool

Dim mos As System.Management.ManagementObjectSearcher

Dim moc As System.Management.ManagementObjectCollection

Dim mo As System.Management.ManagementObject

Dim prop As System.Management.PropertyData

Dim FSO As Object

Dim txtstream As Object

Dim MyString As String

mos = New System.Management.ManagementObjectSearcher("SELECT * FROM
Win32_NetworkAdapterConfiguration Where Index = 0")

moc = mos.Get()

For Each mo In moc

MessageBox.Show(mo.GetText(Management.TextFormat.Mof))

Next

HTH


Quote:
> Is there a way of accessin the dhcp info in vb.net.
> i want to get which computer has been assigned which ip
> address.

> Can this be done?

> Thanks

> Roland



Tue, 26 Apr 2005 23:15:16 GMT  
 dhcp Info in vb.net
Thanks

I've not tried it yet, but have one more question.
What if i run the program on a computer that is not the
dhcp server?

I won't be able to try this till monday now, but just
wondered.

The computer running the program will be logged onto the
domain (server it winnt 4, client is win2000 pro)

Thanks again.

Quote:
>-----Original Message-----
>I can think of about three but I'll keep it to one. Add
a reference to
>Windows Management.

>    Private Sub Form1_Load(ByVal sender As

System.Object, ByVal e As
Quote:
>System.EventArgs) Handles MyBase.Load

>        'this is entirely new syntax for wmi
>        'instead of having to dim a locator and services
object, we call the
>managementobjectsearcher
>        'totally cool

>Dim mos As System.Management.ManagementObjectSearcher

>Dim moc As System.Management.ManagementObjectCollection

>Dim mo As System.Management.ManagementObject

>Dim prop As System.Management.PropertyData

>Dim FSO As Object

>Dim txtstream As Object

>Dim MyString As String

>mos = New System.Management.ManagementObjectSearcher
("SELECT * FROM
>Win32_NetworkAdapterConfiguration Where Index = 0")

>moc = mos.Get()

>For Each mo In moc

>MessageBox.Show(mo.GetText(Management.TextFormat.Mof))

>Next

>HTH


message

>> Is there a way of accessin the dhcp info in vb.net.
>> i want to get which computer has been assigned which ip
>> address.

>> Can this be done?

>> Thanks

>> Roland

>.



Wed, 27 Apr 2005 00:54:03 GMT  
 dhcp Info in vb.net
It will also provide you with information regarding statically assigned IPs
as well.

HTH


Quote:
> Thanks

> I've not tried it yet, but have one more question.
> What if i run the program on a computer that is not the
> dhcp server?

> I won't be able to try this till monday now, but just
> wondered.

> The computer running the program will be logged onto the
> domain (server it winnt 4, client is win2000 pro)

> Thanks again.

> >-----Original Message-----
> >I can think of about three but I'll keep it to one. Add
> a reference to
> >Windows Management.

> >    Private Sub Form1_Load(ByVal sender As
> System.Object, ByVal e As
> >System.EventArgs) Handles MyBase.Load

> >        'this is entirely new syntax for wmi
> >        'instead of having to dim a locator and services
> object, we call the
> >managementobjectsearcher
> >        'totally cool

> >Dim mos As System.Management.ManagementObjectSearcher

> >Dim moc As System.Management.ManagementObjectCollection

> >Dim mo As System.Management.ManagementObject

> >Dim prop As System.Management.PropertyData

> >Dim FSO As Object

> >Dim txtstream As Object

> >Dim MyString As String

> >mos = New System.Management.ManagementObjectSearcher
> ("SELECT * FROM
> >Win32_NetworkAdapterConfiguration Where Index = 0")

> >moc = mos.Get()

> >For Each mo In moc

> >MessageBox.Show(mo.GetText(Management.TextFormat.Mof))

> >Next

> >HTH


> message

> >> Is there a way of accessin the dhcp info in vb.net.
> >> i want to get which computer has been assigned which ip
> >> address.

> >> Can this be done?

> >> Thanks

> >> Roland

> >.



Wed, 27 Apr 2005 01:39:53 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. ? getting ip and dhcp info from linksys befsr41

2. DHCP Info

3. Getting DHCP info

4. system info in vb.net

5. With VB.NET read header info from FoxPro DBF files

6. how to get hardware info in vb.net?

7. Free .NET Tests, .NET Info, and Sample code

8. VB.NET Technical Info?

9. Looking for ANY info on WMI and VB.NET

10. INFO: Converting VBScript to VB.NET::Variable Allocation and Typing

11. DHCP and VB

12. HELP: Changing Ip/DHCP address in VB

 

 
Powered by phpBB® Forum Software