/// <summary> /// 读文件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Btn_XMLTextRead_Click(object sender, EventArgs e) { List <BookModel> modelList = new List <BookModel>(); modelList = ReadandWriteXML.XMLTextReadFunc(); this.dataGridView1.DataSource = modelList; }
/// <summary> /// 写文件,默认覆盖原文件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Btn_XMLTextWrite_Click(object sender, EventArgs e) { ReadandWriteXML.XMLTextWriteFunc(); Btn_XMLTextRead_Click(sender, e); }