How to download/upload files from/to SharePoint 2013 using CSOM?

后端 未结 8 2181
佛祖请我去吃肉
佛祖请我去吃肉 2020-11-30 20:19

I am developing a Win8 (WinRT, C#, XAML) client application (CSOM) that needs to download/upload files from/to SharePoint 2013.

How do I do the Download/Upload?

8条回答
  •  臣服心动
    2020-11-30 20:58

    I would suggest reading some Microsoft documentation on what you can do with CSOM. This might be one example of what you are looking for, but there is a huge API documented in msdn.

    // Starting with ClientContext, the constructor requires a URL to the 
    // server running SharePoint. 
    ClientContext context = new ClientContext("http://SiteUrl"); 
    
    // Assume that the web has a list named "Announcements". 
    List announcementsList = context.Web.Lists.GetByTitle("Announcements"); 
    
    // Assume there is a list item with ID=1. 
    ListItem listItem = announcementsList.Items.GetById(1); 
    
    // Write a new value to the Body field of the Announcement item.
    listItem["Body"] = "This is my new value!!"; 
    listItem.Update(); 
    
    context.ExecuteQuery(); 
    

    From: http://msdn.microsoft.com/en-us/library/fp179912.aspx

提交回复
热议问题