共用方式為


SPRegionalSettings.ShowWeeks property

取得或設定布林值,指定在行事曆的每日或每週檢視中顯示每週數字。

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

Syntax

'宣告
Public Property ShowWeeks As Boolean
    Get
    Set
'用途
Dim instance As SPRegionalSettings
Dim value As Boolean

value = instance.ShowWeeks

instance.ShowWeeks = value
public bool ShowWeeks { get; set; }

Property value

Type: System.Boolean
顯示行事曆 ; 上週true否則,請false。

Examples

下列程式碼範例會設定行事曆類型為西曆,並啟用顯示的週數。

Dim siteCollection As New SPSite("https://localhost")
Try
    Dim rootWebSite As SPWeb = siteCollection.RootWeb
    Dim regionalsettings As SPRegionalSettings = rootWebSite.RegionalSettings
    regionalsettings.CalendarType = 0
    regionalsettings.ShowWeeks = True

    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.CalendarType = 0; 
        oRegionalSettings.ShowWeeks = true; 
        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