Ejemplo n.º 1
0
        public void ToStringTest()
        {
            LicData data = new LicData();

            data.ExtraContent = "123";
            string str = ConvertObject.ConvertObjectToXML(typeof(LicData), data);
            object d2  = ConvertObject.ConvertXMLToObject(typeof(LicData), str);

            Assert.AreEqual("", "");
        }
 /// <summary>
 /// 返回注册信息
 /// </summary>
 /// <param name="str"></param>
 /// <returns></returns>
 public LicData Dectry(string str)
 {
     try
     {
         string  s    = DESDecrypt(str);
         LicData data = ConvertObject.ConvertXMLToObject <LicData>(s);
         return(data);
     }
     catch
     {
         return(null);
     }
 }
 /// <summary>
 /// 加密注册信息对象并返回加密结果
 /// </summary>
 /// <param name="data">加密对象</param>
 /// <returns>返回加密后的字符串</returns>
 public string Entry(LicData data)
 {
     try
     {
         string str      = ConvertObject.ConvertObjectToXML(data);
         string entrystr = DESEncrypt(str);
         return(entrystr);
     }
     catch
     {
         return(String.Empty);
     }
 }