共用方式為


SPRegionalSettings.AlternateCalendarType property

取得或設定用於伺服器的備用行事曆類型。

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

Syntax

'宣告
Public Property AlternateCalendarType As Short
    Get
    Set
'用途
Dim instance As SPRegionalSettings
Dim value As Short

value = instance.AlternateCalendarType

instance.AlternateCalendarType = value
public short AlternateCalendarType { get; set; }

Property value

Type: System.Int16
指定的備用行事曆類型為 16 位元整數。

備註

AlternateCalendarType屬性可接受下列 integer 值:

  • 0 -無

  • 1 — 西曆

  • 3 — 日本天皇曆

  • 5 — 韓文 (檀紀)

  • 6 — 回曆

  • 7 — 泰曆

  • 8 — 希伯來陰曆

  • 9 — 西曆中東法文行事曆

  • 10 — 阿拉伯文西曆

  • 11 — 音譯英文西曆

  • 12 — 音譯法文西曆

  • 16 — 塞迦曆

如果設為任何其他值,西曆會使用。

Examples

下列程式碼範例會將網站的替代行事曆設定為泰曆。

Dim siteCollection As New SPSite("https://localhost")
Try
    Dim rootWebSite As SPWeb = siteCollection.RootWeb
    Dim regionalsettings As SPRegionalSettings = rootWebSite.RegionalSettings
    regionalsettings.AlternateCalendarType = 7

    rootWebSite.Update()
    rootWebSite.Dispose()
Finally
    siteCollection.Dispose()
End Try
using (SPSite oSiteCollection = new SPSite("https://localhost"))
{
    using (SPWeb oWebsiteRoot = oSiteCollection.RootWeb)
    {
        SPRegionalSettings oRegionalSettings = oWebsiteRoot.RegionalSettings;
        oRegionalSettings.AlternateCalendarType = 7;
        oWebsiteRoot.Update();
    }
}
注意事項注意事項

Certain objects implement the IDisposable interface, and you must avoid retaining these objects in memory after they are no longer needed. For information about good coding practices, see Disposing Objects.

請參閱

參照

SPRegionalSettings class

SPRegionalSettings members

Microsoft.SharePoint namespace