SPRegionalSettings.WorkDayStartHour 属性

获取或设置服务器上所用日历中的工作日默认开始小时时间。

命名空间:  Microsoft.SharePoint
程序集:  Microsoft.SharePoint(位于 Microsoft.SharePoint.dll 中)

语法

声明
Public Property WorkDayStartHour As Short
    Get
    Set
用法
Dim instance As SPRegionalSettings
Dim value As Short

value = instance.WorkDayStartHour

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

属性值

类型:System.Int16

  • 启动指定的工作日的频率的默认小时 16 位整数。

备注

以下列表显示了可能的值和它们代表的时间点:

  • 0 -12:00 AM

  • 60 -1:00 AM

  • 120 -2:00 AM

  • 180 -3:00 AM

  • 240 -4:00 AM

  • 300 -5:00 AM

  • 360 -6:00 AM

  • 320 -7:00 AM

  • 480 -8:00 AM

  • 540 -9:00 AM

  • 600 -10:00 AM

  • 660 -11:00 AM

  • 720 -12:00 PM

  • 780 -1:00 PM

  • 840 -2:00 PM

  • 900 -下午 3:00

  • 960 -4:00 PM

  • 1020 -5:00 PM

  • 1080 -6:00 PM

  • 1140 -7:00 PM

  • 1200 -8:00 PM

  • 1260 -9:00 PM

  • 1320 -10:00 PM

  • 1380 -11:00 PM

示例

下面的代码示例将设置为上午 9 点到根网站的区域设置中下午 6 点的结束时间的开始时间。

Dim siteCollection As New SPSite("https://localhost")
Try
    Dim rootWebSite As SPWeb = siteCollection.RootWeb
    Dim regionalsettings As SPRegionalSettings = rootWebSite.RegionalSettings
    regionalsettings.WorkDayStartHour = 540
    regionalsettings.WorkDayEndHour = 1080

    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.WorkDayStartHour = 540; 
        oRegionalSettings.WorkDayEndHour = 1080; 
        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 类

SPRegionalSettings 成员

Microsoft.SharePoint 命名空间