SourceCode/RFrameGenerate.BLL/Config/WebConfig.cs

(开头部分) 1KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;
using System.Web;
using System.Xml;

namespace RFrameGenerate.BLL
{
    /// <summary>
    /// web配置类
    /// </summary>
    public sealed class WebConfig
    {
        static XmlDocument doc = new XmlDocument();
        /// <summary>
        /// 读取配置文件(所有节点全部小写)
        /// </summary>
        /// <param name="xpath"></param>
        /// <returns></returns>
        public static string ReadConfig(string xpath)
        {
            string path;
            if (HttpContext.Current != null)
            {
                path = HttpContext.Current.Server.MapPath("~/CustomConfig.config");
            }
            else
            {
                path = AppDomain.CurrentDomain.BaseDirectory + "CustomConfig.config";
            }
            doc.Load(path);

            XmlNode element = doc.SelectSingleNode(xpath.ToString());
            if (element == null)
                throw new Exception("找不到配置节点:" + xpath);
            return element.InnerText;

        }

        #region 节点定义

        /// <summary>
        /// 编号规责
        /// </summary>
        public enum AutoCodeFormat
        {
            /// <summary>
            /// 角色编号规责
            /// </summary>
            [Remark("角色", "customconfig/format/rolecode")]
            RoleCode = 0,
            /// <summary>
            /// 会员编号规责
            /// </summary>
            [Remark("会员编号", "customconfig/format/membercode")]
            MemberCode = 0,
        }

后面还有 3 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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