请问,怎样用C#代码来删除一个存在于服务器端的xml文件!

解决方案 »

  1.   

    File.Delete 方法
    删除指定的文件。如果指定的文件不存在,则不引发异常。File.Delete(Server.MapPath(strPath));
      

  2.   

    string path="your xml file path";if (File.Exist(path))
    {
       File.Delete(path)
    }
      

  3.   

    string filepath = Server.MapPath(filename)
    File.Delete(filepath);
    注意要给你删除的文件修改一下权限
      

  4.   

    string filepath = Server.MapPath(filename)
    File.Delete(filepath);
    注意要给你删除的文件修改一下权限
      

  5.   

    using System.IO;string FilePath="..\\XXX.xml"
    File.Delete(Server.MapPath(FilePath));注意文件权限