Why did exception happen in such situation?

  • Thread starter Thread starter Stan Huang at Taiwan
  • Start date Start date
S

Stan Huang at Taiwan

Guest
My current trouble is an exception occurred when I set value to a property, TrialMode, of a class NLicenseManager. Class NLicenseManager code is at below. The executed code snippet which caused Exception is as below. Why did statement "NLicenseManager.TrialMode = false" cause exception?


-------------------------------

using Neurotec.Tutorials;
using Neurotec.Biometrics;
using Neurotec.Biometrics.Client;
using Neurotec.Licensing;

namespace VeriFace
{

.......

class Veriface
{

.......

public bool Verify(string image1, string image2)
{
bool test;
const string licenses = "FaceMatcher,FaceExtractor";

NLicenseManager.TrialMode = false;

.....

}



-----------------------------------------------------------

namespace Neurotec.Licensing
{
//
// Summary:
// Provides functionality for licenses management.
public static class NLicenseManager
{
//
// Summary:
// Gets or sets proxy port number of licensing server.
public static int ProxyPort { get; set; }
//
// Summary:
// Gets or sets the path of writable storage.
public static string WritableStoragePath { get; set; }
//
// Summary:
// Enables or disables trial mode of SDK (trial mode flag is set in Bin/Licenses/TrialFlag.txt).
public static bool TrialMode { get; set; }
//
// Summary:
// Defines the native type of the license type.
public static NType NLicenseTypeNativeType { get; }
//
// Summary:
// Defines the native type of the object.
public static NType NativeType { get; }
//
// Summary:
// Gets or sets proxy server host name.
public static string ProxyHost { get; set; }

//
// Summary:
// Retrieves handle to the first attached dongle.
//
// Returns:
// If the method succeeds the return value is handle to attached dongle. Otherwise,
// the return value is null.
//
// Remarks:
// FindNextDongle and FindFirstDongle methods can be used to iterate through all
// attached dongles. FindNextDongle is used to get handles of all the subsequent
// dongles attached.
public static NLicManDongle FindFirstDongle();
//
// Summary:
// Finds next attached dongle. This method is used together with FindFirstDongle
// method.
//
// Returns:
// If the function succeeds the return value is a handle to found dongle. Otherwise,
// the return value is null.
public static NLicManDongle FindNextDongle();
//
// Summary:
// Generates product license from computer Id.
//
// Parameters:
// id:
// String that contains computer Id file data. You should read computer ID file
// to this string.
//
// sequenceNumber:
// Sequence number used for licenses accounting.
//
// productId:
// ID of a product for which license was generated.
//
// Returns:
// If the method succeeds the return value is a string that contains generated license
// data.
//
// Remarks:
// For every generated license count of licenses in a dongle will be decreased by
// 1. When generating licenses these constraints should be considered: 1. Only one
// instance of license generating process should be present. 2. pg.exe can not be
// started.
public static string GenerateLicense(string id, out int sequenceNumber, out uint productId);
//
// Summary:
// Generates serial number for a specified product.
//
// Parameters:
// productId:
// Id of a product to generate serial number.
//
// sequenceNumber:
// Sequence number used for licenses accounting. User must store sequence number
// in own database.
//
// distributorId:
// Id of a distributor for which serial number should be generated.
//
// Returns:
// If the method succeeds a string which contains generated serial number is returned.
public static string GenerateSerial(uint productId, int sequenceNumber, out int distributorId);
//
// Summary:
// Retrieves all Neurotec dongles
//
// Returns:
// If the method succeeds the return value is array of dongles. Otherwise exception
// will be thrown.
public static NLicManDongle[] GetDongles();
//
// Summary:
// Retrieves license data for a specified product license.
//
// Parameters:
// id:
// A string that contains computer Id file data. Computer Id file should be scanned
// before passing it to method. String passed to method should contain null terminating
// character.
//
// sequenceNumber:
// Sequence number used for licenses accounting.
//
// productId:
// Product Id.
//
// distributorId:
// Distributor Id.
public static void GetLicenseData(string id, out int sequenceNumber, out uint productId, out int distributorId);
//
// Summary:
// Retrieves full name of a product specified by product info.
//
// Parameters:
// productInfo:
// NLicenseProductInfo object to retrieve info.
//
// Returns:
// A string which contains full product name.
public static string GetLongProductName(NLicenseProductInfo productInfo);
//
// Summary:
// Retrieves full name of a product specified by product Id.
//
// Parameters:
// productId:
// Id of a product to retrieve full name.
//
// licenseType:
// Type of the licenses.
//
// Returns:
// A string that contains full product name specified by productID.
public static string GetLongProductName(uint productId, NLicenseType licenseType);
//
// Summary:
// Retrieves a list of all Neurotechnology products Ids.
//
// Returns:
// An UInt array that contains all products Ids.
public static uint[] GetProductIds();
//
// Summary:
// Retrieves short name of a product specified by product Id.
//
// Parameters:
// productId:
// Id of a product to retrieve short name.
//
// licenseType:
// Type of the licenses.
//
// Returns:
// A string that contains short product name.
public static string GetShortProductName(uint productId, NLicenseType licenseType);
//
// Summary:
// Retrieves short name of a product from specified NLicenseProductInfo.
//
// Parameters:
// productInfo:
// NLicenseProductInfo object to retrieve short info.
//
// Returns:
// A string which contains a short product name.
public static string GetShortProductName(NLicenseProductInfo productInfo);
//
// Summary:
// Gets specified ticket number update info.
//
// Parameters:
// ticketNumber:
// Zero terminated string containing ticket number.
//
// Returns:
// NLicManDongleUpdateTicketInfo object.
public static NLicManDongleUpdateTicketInfo GetUpdateTicketInfo(string ticketNumber);
//
// Summary:
// Checks whether the specified license type is supported.
//
// Parameters:
// productId:
// Id of a product.
//
// licenseType:
// Type of the license.
//
// Returns:
// true if the license type is supported, else false.
public static bool IsLicenseTypeSupported(uint productId, NLicenseType licenseType);
}
}

Continue reading...
 
Back
Top