ActiveSocket Toolkit Add network capabilities to any Windows or .NET application

Quicklinks


ASP 2.x NTP Network Time Protocol Sample Source Code

ActiveSocket provides an easy-to-use development interface to a variety of IP protocols. By using ActiveSocket, you can very easily create or enhance applications with network features.

ActiveSocket features the following: DNS, FTP, HTTP, HTTPs, ICMP Ping, IP-to-Country, MSN, NTP, RSH, SCP, SFTP, SNMP v1/v2c (Get, GetNext, Set), SNMP Traps, SNMP MIB, SSH, TCP, Telnet, TFTP, UDP, Telnet, Wake-On-LAN and more.

ActiveSocket can be well integrated into ASP environments. This document describes how ActiveSocket can be integrated into ASP projects.

Step 1: Download and install ActiveSocket

Download ActiveSocket from the ActiveXperts Download Site and start the installation. The installation guides you through the installation process.

Step 2: Create a new Web Site

First, create a new directory on the IIS Server's file system. This directory will hold the ASP later on.

From the 'Start menu', click on 'Administrative Tools' and click on 'Internet Information Services (IIS) Manager'. Right-click on the 'Web Sites' container and choose 'New->Web Site':

ASP

(Click on the picture to enlarge)

The 'Web Site Creation Wizard' is shown, guiding you thorugh the process of creating a new web site. Provide all necessary information:

  • Description - a friendly description of the new site;
  • IP / Port / Host Header - choose your preferred way to distinguish between other web sites on the server;
  • Path - select the directory that will store the ASP file(s);
  • Web Site Access Permissions - in the Web Site Access Permissions dialog, enable 'Read' and 'Run scripts (such as ASP)';

You're now able to write an ASP script to use IP protocols with ActiveSocket.

Step 3: Create the ActiveSocket object in ASP

Create a new ASP script called DEFAULT.ASP in the directory that was created in Step2, using your favorite editor. On top of the ASP code, insert the following lines to declare and create the ActiveSocket object:

<object runat=server progid="ActiveXperts.Ntp" id=objNtp></object>

Full Sample Code

There are NTP samples included with the product. You can also find them on the ActiveXperts FTP site: ftp.activexperts-labs.com/samples/network-component