Overview
This OCX file, URLChecker.ocx, contains a control URLCheck, that checks a given URL by attempting to access it via the http protocol.
The control can be visible at run time, in which it shows the text
retrieved from the URL if successful. If you don't want to see this you can set
the control's.visible property to False.
Properties
These properties control the behaviour of the control:
.readPrefix - a string that will be prepended to all submitted URLs. Makes
it easier if you are checking a lot of URLs in the same site, or want to limit
the scope of access to a specific site.
.timeOutInterval - number of milliseconds to wait before timeout event is
raised
Methods
The methods are used to initiate or cancel access to a URL:
.AsyncCheck(URL as string) - attempts to open the given URL. Note that this is
asynchronous, so return is made from this call before a result is obtained. The
result is indicated by firing of one of the three possible events.
.SyncCheck(URL as string) - attempts to open the given URL. This is synchronous, so
return is not made back to the caller until a result has been obtained. The result is
indicated by the return value: 0 - success 1 - Error 2 - Timeout 3 - Cancelled. In the
case of success the message read can be got by calling the .message method
.Message - Returns the message retrieved from the URL if successful, othewise the
text describing the error condition.
.Cancel - cancels a previously - attempted read.
Events
The three possible outcomes after an .AsyncCheck are indicated by events raised as follows:
_success(rs as string) - The access to the URL was successful, rs gives the
page that was returned from the URL.
_timeout - The access timed out - you can set the time-out period using the .timeOutInterval property
_error (ErrCode as long, Msg as string)- There was an error, text describes the
error.