首页  ·  知识 ·  
Label
      编辑:  图片来源:网络
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.IO;
namespace FLX.ComplexQuery
{
    /**//// <summary>
    /// deletepic 的摘要说明。
    /// </summary>
    public class deletepic : System.Web.UI.Page
    {
        protected System.Web.UI.WebControls.Button Button1;
           
        private void Page_Load(object sender, System.EventArgs e)
        {
            // 在此处放置用户代码以初始化页面   
        }
        private void deletefile(System.IO.DirectoryInfo path)  
        {  
            foreach(System.IO.DirectoryInfo d in path.GetDirectories())  
            {  
                deletefile(d);  
            }  
            foreach(System.IO.FileInfo f in path.GetFiles())  
            {  
                f.Delete();    
            }  
        } 
        Web 窗体设计器生成的代码#region Web 窗体设计器生成的代码
        override protected void OnInit(EventArgs e)
        {
            //
            // CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。
            //
            InitializeComponent();
            base.OnInit(e);
        }
       
        /**//// <summary>
        /// 设计器支持所需的方法 - 不要使用代码编辑器修改
        /// 此方法的内容。
        /// </summary>
        private void InitializeComponent()
        {   
            this.Button1.Click += new System.EventHandler(this.Button1_Click);
            this.Load += new System.EventHandler(this.Page_Load);
        }
        #endregion
        private void Button1_Click(object sender, System.EventArgs e)
        {           
            System.IO.DirectoryInfo path = new System.IO.DirectoryInfo(Server.MapPath("~/ChartImages"));
            deletefile(path);
        }
    }
}
 
本文作者:网友 来源:其它 | http://www.cnblogs.com/dreamof/archive/2010/09/04/1818032.html
CIO之家 www.ciozj.com 微信公众号:imciow
   
免责声明:本站转载此文章旨在分享信息,不代表对其内容的完全认同。文章来源已尽可能注明,若涉及版权问题,请及时与我们联系,我们将积极配合处理。同时,我们无法对文章内容的真实性、准确性及完整性进行完全保证,对于因文章内容而产生的任何后果,本账号不承担法律责任。转载仅出于传播目的,读者应自行对内容进行核实与判断。请谨慎参考文章信息,一切责任由读者自行承担。
延伸阅读
也许感兴趣的
我们推荐的
主题最新
看看其它的
收藏至微信