using System; using System.Text; using System.Runtime.InteropServices; using PersistentSecurity; //************************************************************************************* //* //* Check for a node-locked "monitor" license, version "6.0" //* //************************************************************************************* class Nodelocked { static void Main() { int daysRemaining=0; StringBuilder szMessage = new StringBuilder(1025); // make this application use an external license file PSProlibProxy.sgSetAttrInt(PSProlibProxy.SG_ATTRTYPE.SG_ATTR_LICENSETYPE,(int)PSProlibProxy.SG_LICENSETYPE.SG_LICENSETYPE_EXTERNAL); // the @ symbol tells the software the license file is next to this executable. if (PSProlibProxy.sgAuthorized("@monitor.lic","monitor","6.0") != PSProlibProxy.SG_AUTHORIZED) { // tell the user they are not licensed for the application and exit gracefully PSProlibProxy.sgGetLastErrorString(szMessage); Console.WriteLine("{0}",szMessage); Environment.Exit(1); } PSProlibProxy.sgExpireDays("@monitor.lic","monitor","6.0",ref daysRemaining); Console.WriteLine("Enabling the monitor functionality for {0} days....",daysRemaining); Console.WriteLine("Running the monitor application...."); Environment.Exit(0); } }