KJA
 
KJA Home

Web Toys

Activex Components

Support Forum

Contact Us

Links & Resources

KUTIL Component:
Download Demo  Buy It - Instant Download!

What can I do with a 'kutil component' ???

The kutil component is a collection of network utilities. kUtil currently includes: PING, TRACEROUTE, WHOIS, IP2HOST, HOST2IP and more. You Sales staff might like to add this to have this online to show how your network is fast and everyone else's network is so sloooowww!

Release Notes:

  • This component is written in Microsoft Visual Basic 6.0.
  • MSIE must be installed. ( http://www.microsoft.com/ )
  • You will need the VB 6.0 Runtime files. You can download them here VB 6.0 Runtime
  • If you receive this error "ActiveX Component Can't Create Object" Then download this file - Place it in a temp folder and double click it to run. This corrects a registry issue.

Registered owners may request a free update here.


Features:
  • Ping
  • Traceroute
  • Delay
  • Whois
  • ip2host
  • host2ip
  • Sample code included for all methods.
  • SUPPORT - SUPPORT - SUPPORT - If it doesn't do something, just ask - we might just add that feature for you.

System requirements:

This component runs on Windows 95,98,NT,2000. It supports the following languages - ASP ( active server pages ) , Visual Basic, and VBScript. Minimum System: Pentium 90 with 32 meg ram

KUTIL Component:
Download Demo  Buy It - Instant Download!

USAGE:
PROPERTY TYPE
.ip String
IP of  ping target.
Read Only - property used for ping result - see ping example code.
.bytes Int
Number of bytes sent to ping target.
Read Only - property used for ping result - see ping example code.
.time Int
Response time of ping target.
Read Only - property used for ping result - see ping example code.
.ttl Int
Time To Live
Read Only - property used for ping result - see ping example code.

METHOD RETURN VALUE
.delay(int seconds) none
This method wait for n seconds to return. This is useful for creating pauses in execution.

Example:

	'wait for 5 seconds
response.write "<P>START: " & now()
Dim kutil
Set kutil = CreateObject("kutil.util")
call kutil.delay(5)
set kutil = nothing
response.write "<P>FINISH: " & now()
.getDomainFromHostname(String hostname) String
This function returns the host name portion of a host. 'www.stores.rainfall.com' becomes 'rainfall.com'.

Example:

Dim kutil
Set kutil = CreateObject("kutil.util")
dim sDomain
dim sHost
sHost = "www.orlando.orange.fl.us"
sDomain = kutil.getDomainFromHostname(sHost)
response.write "<P>sHost is " & sHost
response.write "<P>Domain is " & sDomain
set kutil = nothing
.host2ip(String host) Array
Returns a "1" based array of ip addresses for a given host. Some host have more than one ip, like "www.yahoo.com". If no ip is found, the array has no element above "0" ( element 0 is meaningless )

Example:

	Dim kutil
Set kutil = CreateObject("kutil.util")
dim sHost
dim aryIp
dim i
sHost = "www.yahoo.com"
aryIp = kutil.host2ip(sHost)
response.write "<P>" & sHost
for i = 1 to ubound(aryIp)
response.write "<br>--&gt; " & aryIp(i)
next
set kutil = nothing
.ip2host(String ip) String
Returns the host name of a given ip address as a string.

Example:

	Dim kutil
Set kutil = CreateObject("kutil.util")
dim sHost
dim sIp
sIp = "168.144.54.51"
sHost = kutil.ip2host(sIp)
response.write "<P>" & sIp & " --&gt; " & sHost
set kutil = nothing
.ping(String host, String data, Int timeout) Boolean
Ping a host and return information in the ip bytes time and ttl properties.This function returns false (0) on failure and a non-zero number on success.

Example:

	Dim kutil
	Set kutil = CreateObject("kutil.util")
	Dim bReturn
	dim host,data,timeout

	data = "Hello" ' enter any string or just ""
	host = "www.rainfall.com"
	timeout = 500 ' milliseconds
	dim i
	response.write "<p>Pinging: " & host & " ..."
	
	for i = 1 to 4
	
		bReturn = kutil.ping(host,data,timeout)
		If bReturn = 0 Then
			response.write "<br>" & _
			kutil.description & vbCrLf
		Else
			response.write "<br>" & _
			"Reply from " & kutil.ip & _
			" bytes=" & kutil.bytes & _
			" time=" & kutil.time & _
			"ms TTL=" & kutil.ttl & vbCrLf
		End If
	next		
	set kutil = nothing	
.traceroute(String host, Bool resolve, Int maxhops, optional String color1, optional String color2) String
This function returns traceroute data as an html formatted string.
host - the host being traced
resolve - resolve ip addresses to hostname. This can cause serious delays
maxhops - maximum number of routers to cross.
color1 - the rrggbb html color for the even table rows
color1 - the rrggbb html color for the odd table rows

Example:

	Dim kutil
	Set kutil = CreateObject("kutil.util")
	dim host,res,hops
	host = "www.rainfall.com"
	res = false
	hops = 99
	Dim sReturn
	sReturn = kutil.traceroute(host,res,hops,"d0d0d0","e0e0e0")
	response.write sReturn
	set kutil = nothing
.whois(String domain) String
Whois returns the information provided by the whois server. Each TLD ( top level domain - .com, .us , .au, etc. ) has it's own whois servers.

A list of ISO country whois servers can be found here:
http://www.apnic.net/maps/tld-list.html

Example:

	
	dim tld
	dim domain
	dim sp
	dim server
	Dim kutil
	dim whois
	Set kutil = CreateObject("kutil.util")
	
	' each TLD requires it's own whois server
	domain = "rainfall.com"
	
	' unremark the next line to see a Russian whois server
	'domain = "karelia.ru"
	
	' just in case someone enter "www.rainfall.com"
	domain = kutil.getDomainFromHostname(domain) 
	
	sp = split(domain,".")
	tld = lcase(trim(sp(ubound(sp))))

	' test for .com, .net, .org, .ededu, .ru
	' you can search for other tld whois severs online
	
	select case tld
		case "com"
		 server = "whois.networksolutions.com"
		case "net"
		 server = "whois.networksolutions.com"
		case "org"
		 server = "whois.networksolutions.com"
		case "ru"
		 server = "whois.ripn.net"
		case else
		 server = "whois.networksolutions.com"
	end select
				
	whois = kutil.whois(domain,server)
	
	response.write "<pre>" & vbCrLf
	response.write whois & vbCrLf
	response.write "</pre>" & vbCrLf
	
	set kutil = nothing