static public bool CompanyLicenseFileIsValid(string filename) { try { FileInfo fi = new FileInfo(filename); if (fi.Exists) { CLicenseManager licMan = new CLicenseManager(false); StreamReader sr = new StreamReader(fi.FullName, Encoding.ASCII); string xml = sr.ReadToEnd(); sr.Close(); xml = Crypto.Decrypt(xml, licMan._cryptoPassword.ToString("N")).Trim(); XmlDocument doc = new XmlDocument(); doc.LoadXml(xml); XmlNode compLicense = doc.SelectSingleNode("CompanyLicense[@Name and @Street and @ZipCode and @City and @Country]"); return(compLicense != null); } } catch/*(Exception ex)*/ { } return(false); }
static public bool LicenseFileIsValid(string filename) { try { FileInfo fi = new FileInfo(filename); if (fi.Exists) { CLicenseManager licMan = new CLicenseManager(false); StreamReader sr = new StreamReader(fi.FullName); string xml = sr.ReadToEnd(); sr.Close(); xml = Crypto.Decrypt(xml, licMan._cryptoPassword.ToString("N")); XmlDocument doc = new XmlDocument(); doc.LoadXml(xml); XmlNode license = doc.SelectSingleNode("License[@pwd]"); if (licMan._Password == license.Attributes["pwd"].Value) { return(true); } } } catch { } return(false); }
public License(bool useRegistryKey) { _lic = new CLicenseManager(useRegistryKey); }
public License() { _lic = new CLicenseManager(false); }