SuLei.Web/admin/settings/plugin_list.aspx.cs
(开头部分) 11KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.IO;
using System.Xml;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SuLei.Common;
namespace SuLei.Web.admin.settings
{
public partial class plugin_list : SuLei.UI.ManagePage
{
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
ChkAdminLevel("sys_plugin_config", SLEnums.ActionEnum.View.ToString()); //检查权限
RptBind();
}
}
#region 插件列表绑定==============================
private void RptBind()
{
List<Model.plugin> lt = new List<Model.plugin>();
BLL.plugin bll = new BLL.plugin();
this.rptList.DataSource = bll.GetList(Utils.GetMapPath("../plugins/"));
this.rptList.DataBind();
}
#endregion
#region 删除生成的ASPX文件========================
private void RemoveTemplates(string dirName)
{
string fullPath = Utils.GetMapPath("../plugins/" + dirName + "/"); //插件目录物理路径
DirectoryInfo tempPath = new DirectoryInfo(fullPath + @"templet\"); //插件模板目录实例
XmlNodeList xnList = XmlHelper.ReadNodes(fullPath + SLKeys.FILE_PLUGIN_XML_CONFING, "plugin/urls");
if (xnList.Count > 0)
{
foreach (XmlElement xe in xnList)
{
if (xe.NodeType != XmlNodeType.Comment && xe.Name.ToLower() == "rewrite" && xe.Attributes["page"] != null)
{
if (xe.Attributes["name"] != null && xe.Attributes["type"] != null)
{
//遍历插件模板目录下的站点目录
if (tempPath.Exists)
{
foreach (DirectoryInfo dirInfo in tempPath.GetDirectories())
{
//删除对应站点下的aspx文件
FileHelper.DeleteFile(sysConfig.webpath + SLKeys.DIRECTORY_REWRITE_ASPX + "/" + dirInfo.Name + "/" + xe.Attributes["page"].Value);
}
}
}
}
}
}
后面还有 167 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。
