using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Fm.Bussiness;

public partial class admin_htm_temp_edit : BasePage
{
  
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Request.QueryString["file"] != null)
            {
                
                //实例化文件操作类
                ATL.IO.IOStream stream = new ATL.IO.IOStream();
                
                string file = Request.QueryString["file"].ToString();

                temppath.Text = file;

                //读取模版文件
                tempcontent.Text = stream.ReadFile(Server.MapPath("../")+file);
                
            }
        }
    }
    //保存修改后的模版
    protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
    {
        //实例化文件操作类
        ATL.IO.IOStream stream = new ATL.IO.IOStream();
        stream.WriteFile(Server.MapPath("../") + temppath.Text, tempcontent.Text);
        Response.Redirect("Erro.aspx?eid=模版保存成功!&url=htm_temp_list.aspx", false);
    }
}
