This method retrieves the number of days that remain before the application is locked.

[Visual Basic] Public Function QueryRemainDays() As Integer
[C#] public int QueryRemainDays();

Return Value

A. If the QueryProtect method returns a value of 0 (Unlocked), this method will return the number of days remaining. If a password (with no expiration) has been generated and used to unlock the application, this method will return -1.

B. If the QueryProtect method returns a value of 1 (Locked), this method will return -1 (a password with an expiration has been used and the number of uses, days, or months has been exceeded.)

C. If the QueryProtect method returns a value of 3, 4, or 5 (The number of uses, days, or months has been exceeded), this method returns the number of exceeded uses, days, or months. (For example: if the number of days has been exceeded by 3, the return value of this method is -3).

D. If the QueryProtect method returns a value other than the values mentioned in A, B, or C above, this method returns -1. 

Explanation

The QueryRemainDays method retrieves the number of days that remain before the application is locked. When using "Number of Days", "Number of Months" or "Expiration Date" protection, this method will return the number of days remaining. For all other types of protection, this method will return -1.

The Initialize method must be executed before executing the QueryRemainDays method. If the Initialize method has not been successfully executed, the QueryRemainDays method is disabled.

Also See

PasswordProtect Members | Newtone.ProtectKit.Win.PasswordProtect