LEADTOOLS Medical (Leadtools.Dicom.Server.Admin assembly) Send comments on this topic. | Back to Introduction - All Topics | Help Version 17.0.3.29
Unlock(String) Method
See Also 
Leadtools.Dicom.Server.Admin Namespace > ServiceAdministrator Class > Unlock Method : Unlock(String) Method




code
The LEADTOOLS PACS Framework unlock key.
code
The LEADTOOLS PACS Framework unlock key.
Unlocks the LEADTOOLS PACS Framework.

Syntax

Visual Basic (Declaration) 
Overloads Public Function Unlock( _
   ByVal code As String _
) As Boolean
Visual Basic (Usage)Copy Code
Dim instance As ServiceAdministrator
Dim code As String
Dim value As Boolean
 
value = instance.Unlock(code)
C# 
public bool Unlock( 
   string code
)
Managed Extensions for C++ 
public: bool Unlock( 
   string* code
) 
C++/CLI 
public:
bool Unlock( 
   String^ code
) 

Parameters

code
The LEADTOOLS PACS Framework unlock key.

Return Value

true if the LEADTOOLS PACS Framework was successfully unlocked.

Example

Check to see if LEADTOOLS Dicom Server Framework has been unlocked or is in evaluation mode.

Visual BasicCopy Code
Public Sub LockCheck()
   Dim admin As ServiceAdministrator = New ServiceAdministrator("C:\Program Files\LEAD Technologies, Inc\Leadtools Dicom Server Framework")

   If (Not admin.IsEval) Then
      '
      ' If it isn't an eval then we need to unlock
      '
      If admin.IsLocked Then
         admin.Unlock("Substitute Your Code")
         If admin.IsLocked Then
            Console.WriteLine("Invalid unlock code")
            Return
         Else
            '
            ' Once unlocked the Services property will be valid
            '
            For Each service As KeyValuePair(Of String, DicomService) In admin.Services
               Console.WriteLine(service.Value.Settings.AETitle)
               For Each o As IAddInOptions In service.Value.AddInOptions
                  Console.WriteLine("Option: {0}", o.Text)
               Next o
            Next service
         End If
      End If
      Console.WriteLine("Support is Unlocked")
   Else
      If admin.IsExpired Then
         Console.WriteLine("Evaluation has expired")
      End If
   End If
End Sub
C#Copy Code
public void LockCheck()
{
   ServiceAdministrator admin = new ServiceAdministrator(@"C:\Program Files\LEAD Technologies, Inc\Leadtools Dicom Server Framework");

   if(!admin.IsEval)
   {
      //
      // If it isn't an eval then we need to unlock
      //
      if(admin.IsLocked)
      {
         admin.Unlock("Substitute Your Code");
         if(admin.IsLocked)
         {
            Console.WriteLine("Invalid unlock code");
            return;
         }
         else
         {
            //
            // Once unlocked the Services property will be valid
            //
            foreach(KeyValuePair<string,DicomService> service in admin.Services)
            {
               Console.WriteLine(service.Value.Settings.AETitle);
               foreach(IAddInOptions option in service.Value.AddInOptions)
               {
                  Console.WriteLine("Option: {0}", option.Text);
               }
            }
         }
      }            
     Console.WriteLine("Support is Unlocked");            
   }
   else
   {
      if(admin.IsExpired)
      {
         Console.WriteLine("Evaluation has expired");
      }
   }         
}

Requirements

Target Platforms: Microsoft .NET Framework 2.0, Windows 2000, Windows XP, Windows Server 2003 family, Windows Server 2008 family, Windows Vista, Windows 7

See Also

Leadtools.Dicom.Server.Admin requires a Medical toolkit server license and unlock key. For more information, refer to: Imaging Pro/Document/Medical Features