【问题标题】:how to create checkin checkout functionality in file using client object model in sharepint 2010如何在 sharepoint 2010 中使用客户端对象模型在文件中创建签入签出功能
【发布时间】:2012-07-05 05:35:19
【问题描述】:

您能否告诉我如何使用 SharePoint 2010 中的客户端对象模型在文档库下的文件中创建签入签出功能

感谢卡哈尔

【问题讨论】:

  • 托管客户端对象模型 File.CheckIn 和 JavaScript COM SP.File.checkIn 中都有 CheckIn 方法。您需要确切知道什么?到目前为止你做了什么?
  • 您好,感谢您的回复,我想做文件 - 签到

标签: asp.net sharepoint-2010 sharepoint-clientobject


【解决方案1】:

每次您在 SharePoint 文件中创建、删除或更新元数据时,

建议您在手术前检查,手术后检查。

========================================

//Check Out

clientContext = new Microsoft.SharePoint.Client.ClientContext("Your site here");

clientContext.Credentials = new NetworkCredential("LoginID","LoginPW", "LoginDomain");

clientContext.Load(clientContext.Web);
Microsoft.SharePoint.Client.Web web = clientContext.Web;

Microsoft.SharePoint.Client.File f = web.GetFileByServerRelativeUrl("relative path to the file");

f.CheckOut();

clientContext.ExecuteQuery();

//....... Your operation...............

//Check in

clientContext.Credentials = new NetworkCredential("LoginID","LoginPW","LoginDomain");

clientContext.Load(clientContext.Web);

Microsoft.SharePoint.Client.Web web = clientContext.Web;

Microsoft.SharePoint.Client.File f = web.GetFileByServerRelativeUrl("relative path to the file");

f.CheckIn(String.Concat("File CheckingIn at ", DateTime.Now.ToLongDateString()), 
Microsoft.SharePoint.Client.CheckinType.MajorCheckIn);

clientContext.ExecuteQuery();

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-03-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多