0

現在、私はsharepoint 2010を使用しており、以下のコードを使用してサイトのテーマの色を取得しましたが、デフォルト(テーマなし)を取得すると例外(テーマのURLがnull)が発生します。デフォルトの色(テーマなし)を取得するのを手伝ってください。

using (SPSite site = new SPSite(this.Context.Request.Url.ToString()))
{
  using (SPWeb web = site.OpenWeb())
  {
     string urlTheme = ThmxTheme.GetThemeUrlForWeb(web);                   
     using (ThmxTheme thmxTheme = ThmxTheme.Open(web.Site, urlTheme))
     {
        dark2 = thmxTheme.DarkColor2.DefaultColor.Name;                           
     }
  }
}

ありがとう、

4

1 に答える 1

-1

これはできません。SharePoint テーマ フォルダーには名前の付いたテーマがないため、既定です。

ありがとう

グエン

于 2013-03-12T09:03:21.473 に答える