1、SPListItem.UpdateOverwriteVersion 保存 ,不产生新的版本记录
The SPListItem.UpdateOverwriteVersion method allows for the setting of properties on a SPListItem object without creating a separate version of the item. This method also allows for setting of certain system properties such as Created (date), Modified (date), Author and Editor
using (SPSite sps = new SPSite("http://server/"))
{
using (SPWeb spw = sps.OpenWeb())
{
SPList spSharedDocs = spw.Lists["Shared Documents"];
SPListItem spli = spSharedDocs.Items[0];
spli["Created"] = new DateTime(2007, 1, 1);
spli["Author"] = "-1;#domain\\user";
spli["Editor"] = "-1;#domain\\user";
spli["Modified"] = new DateTime(2007, 2, 1);
spli.UpdateOverwriteVersion();
}
}
2、设置一个站点的起始页 为文档库
SPSite sitecoll = new SPSite(”http://site_name”);
SPWeb site = sitecoll.OpenWeb();
SPFolder fldr = site.RootFolder;
fldr.WelcomePage = “Shared%20Documents/Forms/AllItems.aspx”;
fldr.Update();
site.Update();
site.Dispose();
sitecoll.Dispose();
3\ 更改访问的url
今天老板给各需求:让我把http://usnyc1spm03:87/ 的url转成 http://Aaisgreat
:
下面我讲一下步骤:
1)创建DNS URL
打开DNS 服务器:
1)click"Start->All Programs->Administrative tools->DNS"
2) 新建一个Zones叫 prismshareusa.int.
2) 让后在新建的Zones 下面再创建一个host.叫alpha ,IP地址输入sharepoint的IP
2) 编辑Host Header.
打开网站所在的IIS ,比如我的是87,我打开87 的IIS.
Click "Web Site" Tab.选择Advanced .然后加一个Identification,
IP address:192.168.16.100
Tcp port:80
Host Header value:
3) 去sharepoint管理中心:
click : "Operations" ->"Global configuration/Alternate Access Mappings"
在 Alternate Access Mappings collections 选择 http://aa:33/
让后Edit Public URLs ,在Intranent 里面输入:http://Aaisgreat
Click "save" 就ok了
这样就可以用 http://Aaisgreat地址访问 http://usnyc1spm03:87/的网站。
浙公网安备 33010602011771号