DAL/SiteUrl.cs

(完整代码) 1KB

using System;
using System.Collections;
using System.Text;
using System.Xml;

namespace DAL
{
    public class SiteUrl
    {
        public Hashtable loadConfig(string urlFilePath)
        {
            Hashtable ht = new Hashtable();

            XmlDocument xml = new XmlDocument();
            xml.Load(urlFilePath);

            XmlNode root = xml.SelectSingleNode("urls");
            foreach (XmlNode n in root.ChildNodes)
            {
                if (n.NodeType != XmlNodeType.Comment && n.Name.ToLower() == "rewrite")
                {
                    XmlAttribute name = n.Attributes["name"];
                    XmlAttribute path = n.Attributes["path"];
                    XmlAttribute page = n.Attributes["page"];
                    XmlAttribute querystring = n.Attributes["querystring"];
                    XmlAttribute pattern = n.Attributes["pattern"];

                    if (name != null && path != null && page != null && querystring != null && pattern != null)
                    {
                        ht.Add(name.Value, new Model.SiteUrl(name.Value, path.Value, pattern.Value, page.Value.Replace("^", "&"), querystring.Value.Replace("^", "&")));
                    }
                }
            }
            return ht;
        }
    }
}

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

AI 解读 AI

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

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