protected void BtnZip_Click(object sender, EventArgs e) { CreatePackage(); ShowPackage(); showfilelist(); BtnZip.Enabled = false; string xmlurl = "~/Package/read.xml"; string xmlpath = Server.MapPath(xmlurl); System.IO.File.Delete(xmlpath); //先删除,不存在不引发异常 LearnSite.BLL.Courses cbll = new LearnSite.BLL.Courses(); cbll.CreatPackageNameList(xmlpath); //生成学案包目录对照表 }