Re: Detecting if a there is a license file

  •  09-21-2009, 10:40 AM

    Re: Detecting if a there is a license file

    CuteSoft people did not answer to that post, so I copy here the code I implemented in the case of someone would be interested:
     
    public bool AjaxUploaderLicenseFileExists()
    {
      // get the web application path
      string apppath = System.Web.HttpContext.Current.Server.MapPath(System.Web.HttpContext.Current.Request.ApplicationPath);
      // get the relative path of the AjaxUploader license file
      string licensefile = System.Configuration.ConfigurationManager.AppSettings["AjaxUploaderLicense"];
      if (string.IsNullOrEmpty(licensefile))
        licensefile = "bin\\AjaxUploader.lic";
      // check if the license file exists
      string licensepath = string.Format("{0}\\{1}", apppath, licensefile);
      return System.IO.File.Exists(licensepath);
    }
    Anyway, this method only allows me to check wether the license file exists or not, it does not tell me if it is valid (expired or not).
    I saw in the AjaxUploader developer guide (http://ajaxuploader.com/document/) that there is a UploaderLicenseProvider.GetLicense Method, but there is no explanation telling how to use it :(...
     
View Complete Thread