Backup/Discuz.Web/admin/rapidset/hotfix.aspx.cs
(开头部分) 6KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.IO;
using System.Web.UI.WebControls;
using System.Xml;
using Discuz.Common;
using Discuz.Config;
using Discuz.Web.Admin.AutoUpdateManager;
namespace Discuz.Web.Admin
{
/// <summary>
/// 单个生成模板页面
/// </summary>
public class hotfix : AdminPage
{
protected System.Web.UI.WebControls.Label info = new Label();
protected bool isNew = false;
protected void Page_Load(object sender, EventArgs e)
{
if(!IsPostBack)
{
try
{
//合并升级信息
MergeUpgradeInfo();
//获取官方升级版本列表,并存放到本地upgrade/versionlist.config中
AutoUpdate autoUpdate = new AutoUpdate();
string fileContnet = autoUpdate.GetVersionList();
StreamWriter writer = new StreamWriter(Utils.GetMapPath(BaseConfigs.GetForumPath.ToLower() + "config/upgradeini.config"));
writer.Write(fileContnet.Replace("\n", "\r\n"));
writer.Close();
//取本地更新版本号与官方的最新版本号比较,如果官方有更新,则提示有升级
XmlDocument lastupdate = new XmlDocument();
lastupdate.Load(Utils.GetMapPath(BaseConfigs.GetForumPath.ToLower() + "config/localupgradeini.config"));
//DateTime build = StrToDateTime(lastupdate.SelectSingleNode("/localupgrade/optionalupgrade/item").InnerText);
XmlNodeList local = lastupdate.SelectNodes("/localupgrade/optionalupgrade/dnt" + Utils.GetAssemblyVersion() + "/item");
XmlDocument currentupdate = new XmlDocument();
currentupdate.LoadXml(fileContnet);
XmlNodeList service = currentupdate.SelectNodes("/versionlist/" + BaseConfigs.GetDbType.ToLower() + "/optionalupgrade/dnt" + Utils.GetAssemblyVersion() + "/item");
int i = 0;
string script = "";
foreach (XmlNode serviceitem in service)
{
bool exist = false;
foreach (XmlNode localitem in local)
{
if (serviceitem.FirstChild.InnerText == localitem.InnerText)
{
exist = true;
break;
}
}
if (!exist)
{
isNew = true;
info.Text += "<input type='checkbox' value='" + serviceitem["version"].InnerText + "' id='checkbox" + i + "' checked='checked'><label for='checkbox" + i + "'>" + serviceitem["versiondescription"].InnerText + "</label>";
info.Text += "<p style='border: 1px dotted rgb(219, 221, 211); background: rgb(255, 255, 204);font-size:12px;padding:0px 0px 0px 15px;'>" + serviceitem["description"].InnerText + "</p>";
script += "{\"version\":\"" + serviceitem["version"].InnerText + "\",\"versiondescription\":\"" + serviceitem["versiondescription"].InnerText + "\",\"link\":\"" + serviceitem["link"].InnerText + "\"},";
后面还有 80 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。
