LicenseServer.Connect Method

ClosedDescription

Connects BarTender to the BarTender Licensing Service that owns BarTender's active license (PKC) and returns True (meaning success) or False (meaning failure).

ClosedSyntax

LicenseServer.Connect

ClosedRequirements

Version

BarTender 6.20 or higher

Edition

Automation, Enterprise

ClosedRemarks

BarTender periodically attempts to connect to the BarTender Licensing Service, so calling the method is not required.

ClosedVB.NET Example

'Declare a BarTender application variable

Dim btApp As BarTender.Application

'Create a new instance of BarTender

btApp = New BarTender.Application

'Set the BarTender application visible

btApp.Visible = True

'Check to see if BarTender is connected to the BarTender Licensing Service

If btApp.LicenseServer.Connect = True Then

MessageBox.Show("Connected")

Else

MessageBox.Show("Not Connected")

End If

'End the BarTender process

btApp.Quit(BarTender.BtSaveOptions.btDoNotSaveChanges)

ClosedC# Example

// Declare a BarTender application variable

BarTender.Application btApp;

// Create a new instance of BarTender

btApp = new BarTender.Application();

// Set the BarTender application visible

btApp.Visible = true;

// Check to see if BarTender is connected to the BarTender Licensing Service

if(btApp.LicenseServer.Connect() == true)

{

MessageBox.Show("Connected");

}

else

{

MessageBox.Show("Not Connected");

}

// End the BarTender process

btApp.Quit(BarTender.BtSaveOptions.btDoNotSaveChanges);