Using the component is as simple as

  1. Creating the object
  2. Invoking the Trace method

The following code demonstrates how to use C2GTracer from VBScript. In this example we'll ping this web server www.componentstogo.com.

Set tracert = CreateObject("C2G.Tracert")
Set hob = CreateObject("C2G.Hop")

If Tracert.trace("www.componentstogo.com", 1,64,TRUE) Then
   For Each hop in tracert
      str = str + cstr(hop.number) + " "
      str = str + cstr(hop.rtt) + " " 
      str = str + hop.HostIP + " " 
      str = str + hop.hostname + " "
      Response.Write "<BR> " & str
   Next
Else
    Response.Write "Ping failed due to error: " & str(c2g.LastError)
End if