private static string ToString(ActivationSet item) { using (StringWriter sw = new StringWriter()){ using (ComSpex.XmlPersist <ActivationSet> xp = new ComSpex.XmlPersist <ActivationSet>(item)){ return(xp.Save(sw)); } } }
static void SendNoticeToLix(object param) { using (LicenseService Ls = new LicenseService()) { ActivationSet item = new ActivationSet(Environment.MachineName, typeof(Program).AssemblyQualifiedName); string xml = ActivationSet.ToXmlString(item); Ls.AddActivationSet(xml); } }
static void Main(string[] args) { using (LicenseService Ls = new LicenseService()) { byte[] buff = Encoding.ASCII.GetBytes("boss"); string password = Convert.ToBase64String(buff); string xml = Ls.DownloadActivationSets(password); Report("{0}", xml); using (StreamWriter Sw = new StreamWriter("LicenseManagement.xml", false, Encoding.UTF8)){ Sw.Write(xml); } #if false if (!String.IsNullOrEmpty(xml)) { ActivationSet[] items = ActivationSet.ToArray(xml); foreach (ActivationSet item in items) { Report("{0}", item.ToXmlString()); Report("---------"); } } #endif } }