/// <summary>
/// 保存XML文件
/// </summary>
/// <returns></returns>
public bool SaveXml()
{
//删除原配置文件
if (System.IO.File.Exists(getCallRecodXMLPath()))
{
System.IO.File.Delete(getCallRecodXMLPath());
}
//生成新的配置文件
XmlSerializer ser = new XmlSerializer(typeof(DataSet));
try
{
if (dtCallRecord != null)
{
using (TextWriter writer = new StreamWriter(getCallRecodXMLPath()))
{
ser.Serialize(writer, dsCallRecord);
}
return true;
}
}
catch (System.Exception ex)
{
TestLog.GetInstance().RecordLog("*******************通话记录文件序列化异常************" + ex.Message);
}
return false;
}