标签:
    string file = Server.MapPath("/data.xml");
    Code.ProductDataManage.Instance.ExportToFile(file, b => b.Id > 0);//导出到文件
    Response.Write("成功导出到文件:" + file);
    var xml = Code.ProductDataManage.Instance.ExportToXml(b => b.Id > 0);//导出为字符串
    
    string file = Server.MapPath("/data.xml");
    Code.ProductDataManage.Instance.ImportFromFile(file, b => b.Id > 0);//从文件中导入
    Response.Write("成功从文件导入:" + file);
    //Code.ProductDataManage.Instance.ImportFromXml("", b => b.Id > 0);//从XML序列化字符串导入
    标签:
原文地址:http://www.cnblogs.com/hubro/p/4286383.html