PC Review


Reply
Thread Tools Rate Thread

How to check the Existence of IP Adress

 
 
Rajesh Kaki
Guest
Posts: n/a
 
      28th Dec 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
 
Reply With Quote
 
 
 
 
Vinson
Guest
Posts: n/a
 
      29th Dec 2007
The code you have posted would seem to be incomplete. What ever the case,
you might explore the IsDestinationReachable function found in the
Sensapi.dll.

Vinson

"Rajesh Kaki" wrote:

> 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

 
Reply With Quote
 
Rajesh Kaki
Guest
Posts: n/a
 
      31st Dec 2007
HI Vinson,

Thanks for your response. I tried this method but even this is also not
working in all cases. I tried giving the IP Address which are in use and it
worked correctly. And is also returning true for the machines which are
turned off.
Do we need to set any parameters like that.

---
Thanks
Rajesh Kumar Kaki


"Vinson" wrote:

> The code you have posted would seem to be incomplete. What ever the case,
> you might explore the IsDestinationReachable function found in the
> Sensapi.dll.
>
> Vinson
>
> "Rajesh Kaki" wrote:
>
> > 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

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Check for existence =?Utf-8?B?Q1dpbGxpcw==?= Microsoft Excel Misc 3 31st May 2006 01:20 PM
VBA to check for existence of a DSN =?Utf-8?B?R1BP?= Microsoft Excel Programming 2 29th May 2006 05:22 AM
Check for existence of an object? CK Microsoft C# .NET 5 21st Mar 2006 08:23 PM
Is it possible to check the existence of a URL in asp.net? TaeHo Yoo Microsoft ASP .NET 3 20th Oct 2003 10:14 PM
Is it possible to check the existence of a URL in asp.net? Leon Microsoft ASP .NET 1 18th Oct 2003 12:43 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:24 AM.