namespace Leadtools.Demos
{
internal static class Support
{
public const string MedicalServerKey = "";
#if LEADTOOLS_V19_OR_LATER
public static bool SetLicense(bool silent)
{
try
{
// TODO: Change this to use your license file and developer key */
string licenseFilePath = "E:\\eval-license-files_811c4e6a-f343-48ab-a359-7db7b1052916\\eval-license-files.lic";
string developerKey = "08xPXshT2ZbKbQbDRNFsk4CRW8AQLmUIvN383qJp5TProMTYamPE13uYl3r/CmFEOZzDcuiaOCSDpO9GouHLlx4jSaEsn03u";
RasterSupport.SetLicense(licenseFilePath, developerKey);
}
catch (Exception ex)
{
System.Diagnostics.Debug.Write(ex.Message);
}
if (RasterSupport.KernelExpired)
{
string dir = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
/* Try the common LIC directory */
string licenseFileRelativePath = System.IO.Path.Combine(dir, "E:\\eval-license-files_811c4e6a-f343-48ab-a359-7db7b1052916\\eval-license-files.lic");
string keyFileRelativePath = System.IO.Path.Combine(dir, "E:\\eval-license-files_811c4e6a-f343-48ab-a359-7db7b1052916\\eval-license-files.lic.key");
if (System.IO.File.Exists(licenseFileRelativePath) && System.IO.File.Exists(keyFileRelativePath))
{
string developerKey = System.IO.File.ReadAllText(keyFileRelativePath);
try
{
RasterSupport.SetLicense(licenseFileRelativePath, developerKey);
}
catch (Exception ex)
{
System.Diagnostics.Debug.Write(ex.Message);
}
}
}
if (RasterSupport.KernelExpired)
{
if (silent == false)
{
string msg = "Your license file is missing, invalid or expired. LEADTOOLS will not function. Please contact LEAD Sales for information on obtaining a valid license.";
string logmsg = string.Format("*** NOTE: {0} ***{1}", msg, Environment.NewLine);
System.Diagnostics.Debugger.Log(0, null, "*******************************************************************************" + Environment.NewLine);
System.Diagnostics.Debugger.Log(0, null, logmsg);
System.Diagnostics.Debugger.Log(0, null, "*******************************************************************************" + Environment.NewLine);
MessageBox.Show(null, msg, "No LEADTOOLS License", MessageBoxButtons.OK, MessageBoxIcon.Stop);
System.Diagnostics.Process.Start("https://www.leadtools.com/downloads/evaluation-form.asp?evallicenseonly=true");
}
return false;
}
return true;
}
public static bool SetLicense()
{
return SetLicense(false);
}
#elif LTV18_CONFIG
public static void SetLicense()
{
try
{
RasterSupport.SetLicense("", "Nag");
/* Uncomment this and add your license file and developer key
string licenseFilePath = "Replace this with the path to the LEADTOOLS license file";
string developerKey = "Replace this with your developer key";
RasterSupport.SetLicense(licenseFilePath, developerKey);
*/
}
catch (Exception ex)
{
System.Diagnostics.Debug.Write(ex.Message);
}
}
#endif //LEADTOOLS_V19_OR_LATER
}
} |