⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 stylesheetparser.cs

📁 Freetextbox是优秀的在线编辑器
💻 CS
字号:
namespace FreeTextBoxControls.Support
{
    using System;
    using System.Collections;
    using System.IO;
    using System.Text.RegularExpressions;
    using System.Web;

    public class StyleSheetParser
    {
        public static string[] ParseStyleSheet(string sheetLocation)
        {
            sheetLocation = (HttpContext.Current.Request.PhysicalApplicationPath + sheetLocation.Replace("/", @"\")).Replace(@"\\", @"\");
            if (File.Exists(sheetLocation))
            {
                ArrayList list1 = new ArrayList();
                StreamReader reader1 = File.OpenText(sheetLocation);
                string text1 = reader1.ReadToEnd();
                reader1.Close();
                string text2 = @"\.(?<className>[^}]+)\s*{[^}]*}";
                MatchCollection collection1 = new Regex(text2, RegexOptions.IgnoreCase).Matches(text1);
                if (collection1.Count > 0)
                {
                    for (int num1 = 0; num1 < collection1.Count; num1++)
                    {
                        list1.Add(collection1[num1].Groups["className"].Value);
                    }
                }
                return (string[]) list1.ToArray(typeof(string));
            }
            return new string[] { "file not found.", sheetLocation };
        }

    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -