コード例 #1
0
        public void TestSaveLicenseData()
        {
            var localKey   = "AQLZlMVvXQktYVIxFY5IEd/6iIHOcgCevhYg6FhkZ3f6QQ==";
            var licenseKey = "2S0BXnEvbioHOVH/8xf2kk3UXnMW3AFLPjnDoKvdvx/F04pFPNo8kOhUuaGOCyKDY3azjNlY121+yoFfCMOTMn73BepoxcDFe+vyWxHRj1sBFmlsYNzhZf1CbJRMfG4EHHzyBn4I5hAixwdcBT0HCFH/Y0448zSqfHXdZjwX4RU=";

            var data = new LicenceData
            {
                LocalKey   = localKey,
                LicenceKey = licenseKey
            };

            var store = new DefaultLicenseDataStore();

            store.Save("test", data);
        }
コード例 #2
0
        public static List <LicenceData> getLicenceData()
        {
            List <LicenceData> listA = new List <LicenceData>();
            var filepath             = "Data/ProfileData/licence.csv";

            if (File.Exists(filepath))
            {
                var count = 0;
                using (var reader = new StreamReader(filepath))
                {
                    while (!reader.EndOfStream)
                    {
                        var line   = reader.ReadLine();
                        var values = line.Split(',');
                        if (line == "")
                        {
                        }
                        else
                        {
                            LicenceData lc = new LicenceData();
                            count++;
                            lc.key  = values[0].ToString();
                            lc.days = values[1].ToString();
                            listA.Add(lc);
                        }
                    }
                    reader.Dispose();
                }
                if (count > 0)
                {
                }
            }
            else
            {
            }
            return(listA);
        }