辉_妞

 

2012年5月21日

XML查询,没有则创建

摘要: if (File.Exists(xmlPath + "\\" + xmlName)) //判断文件是否寸在 { //存在的情况下 XmlDocument xmldoc = new XmlDocument(); xmldoc.Load(xmlPath + "\\" + xmlName); //存在文件 XmlNode root = xmldoc.SelectSingleNode("History"); XmlElement bak = xmldoc.CreateElement("Bak"); root.AppendC 阅读全文

posted @ 2012-05-21 10:06 辉_妞 阅读(139) 评论(0) 推荐(0) 编辑

XML文件删除

摘要: //将文件路径赋予字符串xmlFilePathstring xmlFilePath = @"D:\XmlFolder\123.xml";//判断文件是否存在if(File.Exists(xmlFilePath)){ File.Delete(xmlFilePath);}else{ //文件不存在,用对话框向用户提示此信息 MessageBox.Show("文件"+xmlFilePah+"不存在,请确定该文件正确路径!");} 阅读全文

posted @ 2012-05-21 09:37 辉_妞 阅读(297) 评论(0) 推荐(0) 编辑

导航