代码之家  ›  专栏  ›  技术社区  ›  Oundless

在.NET中读取CSS文件

  •  3
  • Oundless  · 技术社区  · 15 年前

    .NET中是否有用于读取CSS文件的类?我想它相当于XMLDocument类与XML文件的内容。

    4 回复  |  直到 13 年前
        1
  •  2
  •   CraigTP    15 年前
        2
  •  1
  •   Oundless    15 年前

    // C#
    CssDocument css = new CssDocument();
    css.Load("c:\mycssfile.css");
    ListDictionary myBodyStyles = css["body"];  // to get all the syles for an element
    string myBodyFontSize = css["body"]["font-size"];  // to get an individual style
    
        3
  •  1
  •   Tim Cooper    13 年前
        4
  •  0
  •   ChrisW    14 年前