惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Y
Y Combinator Blog
GbyAI
GbyAI
U
Unit 42
WordPress大学
WordPress大学
Last Week in AI
Last Week in AI
P
Proofpoint News Feed
D
DataBreaches.Net
N
Netflix TechBlog - Medium
H
Hackread – Cybersecurity News, Data Breaches, AI and More
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
C
Check Point Blog
Martin Fowler
Martin Fowler
月光博客
月光博客
MongoDB | Blog
MongoDB | Blog
MyScale Blog
MyScale Blog
The Cloudflare Blog
Apple Machine Learning Research
Apple Machine Learning Research
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
M
MIT News - Artificial intelligence
云风的 BLOG
云风的 BLOG
罗磊的独立博客
B
Blog RSS Feed
J
Java Code Geeks
The GitHub Blog
The GitHub Blog

博客园 - Sunmoonfire

SharePoint 2013无代码实现列表视图的时间段动态筛选 SharePoint 2013:自定义ECB菜单项的添加 SharePoint Foundation 2013 with SP1 在SharePoint列表中使用自增栏 SharePoint 2010自定义母版页小技巧——JavaScript和CSS引用 通过PowerShell实现SharePoint列表增删改 在SharePoint 2010页面中嵌入SWF文件 在LINQ to SharePoint中使用创建时间,创建者,修改时间,修改者 SharePoint 2010之LINQ与SPMetal 修改SharePoint页面上的控件数量的限制 SharePoint 2010:部署.resx(资源)文件到App_GlobalResources的简单方法 在SharePoint 2010中使用jQuery 在SharePoint 2010环境下区分w3wp进程 打SharePoint 2010 SP1后访问用户配置文件同步服务应用程序出错的解决办法 使用[本人]创建视图筛选时的一个问题和解答 "缺少服务器端相关性"的内容定位 SharePoint 2010开发工具图解系列:Visual Studio 2010创建事件接收器 SharePoint 2010开发工具图解系列:Visual Studio 2010创建列表 SharePoint 2010开发工具图解系列:Visual Studio 2010 SharePoint Tool入门
修改SharePoint列表项显示“新”图标的天数
Sunmoonfire · 2012-08-28 · via 博客园 - Sunmoonfire

当我们在SharePoint中新增一个列表项时,在该列表项的标题后面会显示一个“新”字图标。

默认情况下,是2天内的项会显示“新”。我们可以通过stsadm命令行工具来修改:

C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\BIN>stsa
dm -o setproperty -propertyname days-to-show-new-icon -propertyvalue 30 -url htt
p://moss.contoso.com

在上面的例子中,我的Web应用程序地址是http://moss.contoso.com。通过修改这个Web应用程序属性包中的days-to-show-new-icon属性,就可以控制显示“新”图标的天数。这里改成30。

当然,知道存放位置了,我们也可以通过对象模型来修改:

SPWebApplication oWebApp = SPWebService.ContentService.WebApplications["SharePoint - 80"];
int iDays = oWebApp.DaysToShowNewIndicator;
Console.WriteLine(“原来是-->”+iDays);
oWebApp.DaysToShowNewIndicator = 30;
oWebApp.Update();
iDays = oWebApp.DaysToShowNewIndicator;
Console.WriteLine(“改成-->”+iDays);

其中“SharePoint - 80"是我们创建Web应用程序时填写的名称。这段代码完成的功能和上面的命令行脚本一样。

参考资料

Powershell Script for Changing NEW icon dayslife in SharePoint 2010
How to get the current value for the days-to-show-new-icon property (C#)