Backup/Discuz.Config/MyAttachmentsTypeConfigFileManager.cs
(开头部分) 5KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Text;
using System.Web;
using System.IO;
using Discuz.Common;
using System.Xml.Serialization;
using System.Xml;
namespace Discuz.Config
{
/// <summary>
/// 论坛基本设置管理类
/// </summary>
class MyAttachmentsTypeConfigFileManager : Discuz.Config.DefaultConfigFileManager
{
private static MyAttachmentsTypeConfigInfo m_configinfo;
/// <summary>
/// 文件修改时间
/// </summary>
private static DateTime m_fileoldchange;
/// <summary>
/// 初始化文件修改时间和对象实例
/// </summary>
static MyAttachmentsTypeConfigFileManager()
{
m_fileoldchange = System.IO.File.GetLastWriteTime(ConfigFilePath);
try
{
m_configinfo = (MyAttachmentsTypeConfigInfo)DefaultConfigFileManager.DeserializeInfo(ConfigFilePath, typeof(MyAttachmentsTypeConfigInfo));
}
catch
{
if (File.Exists(ConfigFilePath))
{
ReviseConfig();
m_configinfo = (MyAttachmentsTypeConfigInfo)DefaultConfigFileManager.DeserializeInfo(ConfigFilePath, typeof(MyAttachmentsTypeConfigInfo));
}
}
}
/// <summary>
/// 此函数仅为升级需要
/// </summary>
private static void ReviseConfig()
{
XmlDocument doc = new XmlDocument();
doc.Load(ConfigFilePath);
//1.0正式版升级到2.0
if (doc.DocumentElement.Name != typeof(MyAttachmentsTypeConfigInfo).Name)
{
XmlDocument newdoc = new XmlDocument();
XmlNode declarenode = newdoc.CreateXmlDeclaration("1.0", null, null);
后面还有 108 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。
