📄 stylesheetparser.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 + -