Beispiel #1
0
        static void ProductionMain()
        {
            Thread.CurrentThread.CurrentCulture       =
                Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("ja-JP");
            string licenseKey = "bXvLQ7WQJLz4zOWV5Voyt8RJrQXnZTd1udgGXn+FZUB4Ix1NIYUuy+Rkv7aCSpN/NjkgVcdfJSGvlqvqFXzoFPJAnMUZ/BT4n6Ca+/7R6D0BIVjLHusFpSJblH9EjHPzardNaVkIFMwbUhVytP20Gds3/UAB9AJBR+2OaNV075s=";

            //試用期限2010年02月20日までのライセンス・キーです。
            licenseKey = "RkU0PlcLa0DFX4FKOsNMRqvwwhoxQL1AWr7vqnC7zCeH6MyOX0tcq8Tq87l20rryt0G6a7w5bhrk2L55+AVqqgSQIABHVXRuvt3ZNIOx2iTpzeltbKZ5/dZuCOnVkzNuytNvdyNealCjtQvczlPfwaMGTJ1s8WcxRvpdx8bnhVo=";
            //SendNoticeToLix(null);
            using (LicenseService Ls = new LicenseService()){
                string   text = Ls.ParseLicenseKey(licenseKey);
                DateTime expiry;
                DateTime.TryParse(text, out expiry);
                Report("{0}#{1}", expiry.ToLongDateString(), expiry.ToLongTimeString());
                //Ls.CleanActivationCache();
                Report("{0}", Ls.GetActivationSet("W8V154BX COM1"));
                Report("{0}", Ls.GetActivationSet("W8V154BX COM2"));
                Report("{0}", Guid.NewGuid());
                string[] names = Ls.GetLicenseStateStrings();
                foreach (string name in names)
                {
                    Print(@"case LicenseState.{0}:", name);
                    Print(@"text=ResourceFactory.Get(""License_{0}"");", name);
                    Print(@"break;");
                }
            }
            //GenerateTrialLicenseKey(14);
        }