Example #1
0
 /// <summary>
 /// 构造器 指定DLL文件和全类名
 /// </summary>
 /// <param name="dllFileName">dll文件名</param>
 /// <param name="className">命名空间.类名</param>
 public SerializeJson(string dllFileName, string className)
 {
     errorMessage = string.Empty;
     if (serializeString.IsNull())
     {
         serializeString = (ISerializeString)dllFileName.LoadClass(className);
     }
 }
Example #2
0
 ///<summary>
 /// 序列化
 ///</summary>
 public static string ToJson <T>(T o)
 {
     try {
         if (s_serializeString.IsNull())
         {
             string classNameAndAssembly = WebConfig.GetApp("SerializeJsonProviderName");
             Use(classNameAndAssembly);
         }
         return(s_serializeString.Serialize(o));
     } catch (Exception ex) {
         throw ex;
     }
 }