Initialize an instance of the NetworkTime class.
A boolean value which specifies if the class was initialized successfully.
The Initialize method can be used to explicitly initialize an instance of the NetworkTime class, loading the networking library and allocating resources for the current thread. Typically an application would define the license key as a custom attribute, however this method can be used to initialize the class directly.
The runtime license key for your copy of SocketTools can be generated using the License Manager utility that is included with the product. Note that if you have installed an evaluation license, you will not have a runtime license key and cannot redistribute any applications which use the NetworkTime class.
The following example shows how to use the Initialize method to initialize an instance of the class. This example assumes that the license key string has been defined in code.
[CS]
SocketTools.NetworkTime timeClient = new SocketTools.NetworkTime();
if (timeClient.Initialize(strLicenseKey) == false)
{
MessageBox.Show(timeClient.LastErrorString, "Error",
MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
return;
}
[Visual Basic]
Dim timeClient As New SocketTools.NetworkTime
If timeClient.Initialize(strLicenseKey) = False Then
MsgBox(timeClient.LastErrorString, vbIconExclamation)
Exit Sub
End If