Fish.Member/Common/SiteExtension.cs

(开头部分) 3KB

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

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.IO;
using System.Text;
using System.Xml.Linq;
using Fish.Applications.Dtos;
using Fish.Core.Container;
using Microsoft.AspNetCore.Hosting;
using Fish.Data.Abstractions;

namespace FishCore.Member
{
    public class SiteExtension
    {
        #region Log
        public static string _SiteLog { get; set; }
        public static string SiteLog
        {
            get
            {
                if (string.IsNullOrEmpty(_SiteLog))
                {

                    string path = Path.Combine(ContainerManager.Resolve<IHostingEnvironment>().ContentRootPath, @"wwwroot\CommonFile\Sitelog.txt");
                    if (File.Exists(path))
                        _SiteLog = File.ReadAllText(path, System.Text.Encoding.Default);
                }
                return _SiteLog;
            }
        }
        #endregion

        #region Link
        public static string _SiteLink { get; set; }
        public static string SiteLink
        {
            get
            {
                if (string.IsNullOrEmpty(_SiteLink))
                {
                    StringBuilder _builder = new StringBuilder();
                    string path = Path.Combine(ContainerManager.Resolve<IHostingEnvironment>().ContentRootPath, @"wwwroot\XML\link.xml");
                    if (File.Exists(path))
                    {
                        XElement element = XElement.Load(path);
                        if (element != null)
                        {
                            var result = element.Elements("link");
                            if (result.Any())
                            {
                                foreach (var item in result)
                                {
                                    _builder.AppendFormat("<li><a href=\"{0}\" target='_blank'>{1}</a></li>", GetPath(item.Element("path").Value), item.Element("name").Value);
                                }
                            }
                        }
                    }
                    _SiteLink = _builder.ToString();
后面还有 54 行代码,购买后查看完整代码

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

AI 解读 AI

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

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