当前位置: 代码迷 >> Windows Mobile >> DataContractSerializer序列化解决办法
  详细解决方案

DataContractSerializer序列化解决办法

热度:27   发布时间:2016-04-25 07:19:33.0
DataContractSerializer序列化
    public static bool WriteObjectToFile(string path, Type type, object obj)
        {
            try
            {
                FileStream stream = CreateFile(path);
                new DataContractSerializer(type).WriteObject(stream, obj);
                stream.Close();
                return true;
            }
            catch (Exception)
            {
                return false;
            }
        }

为什么当 obj对象有BitmapImage就引发异常,怎么样才能使对象即使有BitmapImage也不会引发异常

------解决方案--------------------
引用:
Quote: 引用:

你要把BitmapImage序列化??

额。。不可以嘛


没有序列化的必要。
  相关解决方案