Tech Support > Microsoft Windows > Security & Administration > How to check the Existence of IP Adress
How to check the Existence of IP Adress
Posted by Rajesh Kaki on December 28th, 2007


Hi,

I have written a VB6 Code to check for the Availability of IP Address before
assigning it to the machine.
I am using "GetRTTAndHopCount" Windows Function to check. But It is not
working in all cases.

Can any one please let me know Is there any other Function/way to perform
this Task.
Below is the code i have written.

Private Function CheckDuplicate(IPAddress as String) as Boolean
Dim lIPadr As Long
Dim lHopsCount As Long
Dim lRTT As Long
Dim lMaxHops As Long
Dim lResult As Long
Dim rst as String
lIPadr= inet_addr(IPAddress)

limaxHops=15

rst= (GetRTTAndHopCount(lIPadr, lHopsCount, lMaxHops, lRTT)=SUCCESS)

CheckDuplicate=rst
End Sub
--
Rajesh Kumar Kaki


Similar Posts