Fm.Bussiness/model_htm.cs

(完整代码) 1KB

using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.IO;

namespace Fm.Bussiness
{
    /// <summary>
    /// 静态文档处理类
    /// </summary>
    public class model_htm:System.Web.UI.Page
    {
        /// <summary>
        /// 根据文档删除静态文件
        /// </summary>
        /// <param name="docid"></param>
        /// <returns></returns>
        public bool Document_del(int docid)
        {
            //实例化AyongToolsLibrary类库
            ATL.IO.IOStream stream = new ATL.IO.IOStream();
            //查询出栏目目录
            public_select ps = new public_select();
            DataView dv = ps.Getps("Fm_model_view","cl_path","docid="+docid+"");

            //查询文档的静态文件
            DataView dw = ps.Getps("Fm_model_htm","*","docid="+docid+"");
            string path=Server.MapPath("../"+dv[0]["cl_path"].ToString()+"/");
          
            //循环删除
            foreach (DataRow row in dw.Table.Rows)
            {
                if (File.Exists(path + row["path"].ToString()))
                {
                    stream.DeleteFile(path+row["path"].ToString());
                }
            }
            //删除表中数据
            ps.Queryps("delete from Fm_model_htm where docid=" + docid + "");
            return true;
        }
    }
}

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。