我想使用C#从.NET中的sharepoint 2013下载excel表 [英] I want to download a excel sheet from the sharepoint 2013 in .NET using C#

查看:149
本文介绍了我想使用C#从.NET中的sharepoint 2013下载excel表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨朋友们,



我有查询,我正在尝试使用C#.net从SharePoint 2013下载Excel工作表,我尝试了很多方法但是面对问题。



我的共享点URL如下所示我的Excel所在的文件夹:



https://mycompany.sharepoint.com/sites/StudyDocumentIndex/clientMN/My_Client/ASTGF200527-0018/Validation/Forms/AllItems.aspx?RootFolder=%2Fsites%2FStudyDocumentIndex%2FclientMN%2FMerck_Serono%2FASTGF200527-0018%2FValidation% 2FIssues%20Log& FolderCTID = 0x0120001480F292DDAFAE4287EDDB0CE19B3A22& View =%7B358B3C0B-8404-43CC-9A62-8E439C1DDCAE%7D> [ [

Hi Friends,

I have query, that I am trying to download the Excel Sheet from SharePoint 2013 using C# .net, I have tried with many way but facing issue.

My share point URL is like below where in which folder my Excel present :

https://mycompany.sharepoint.com/sites/StudyDocumentIndex/clientMN/My_Client/ASTGF200527-0018/Validation/Forms/AllItems.aspx?RootFolder=%2Fsites%2FStudyDocumentIndex%2FclientMN%2FMerck_Serono%2FASTGF200527-0018%2FValidation%2FIssues%20Log&FolderCTID=0x0120001480F292DDAFAE4287EDDB0CE19B3A22&View=%7B358B3C0B-8404-43CC-9A62-8E439C1DDCAE%7D">[[

推荐答案

您需要使用SharePoint客户端对象模型,通过提供凭据从SharePoint站点下载任何文件。



在项目中包含Microsoft.SharePoint.Client dll引用[无需安装SharePoint]

You need to work with SharePoint Client Object Model, to download any file from SharePoint site by providing credentials.

Include Microsoft.SharePoint.Client dll reference in your project [No need to install SharePoint]
using Microsoft.SharePoint.Client;



此外,您可以关注此博客链接:从SharePoint库下载所有文件



在此博客中选中使用客户端对象模型使用下面的代码部分,代码将下载所有文件。相反,您可以对文件名进行验证。


Further you can follow this blog link : Download all files from SharePoint library

In this blog check Using Client object model use below code section, This code will download all files. Instead you can put validation for your filename.


这篇关于我想使用C#从.NET中的sharepoint 2013下载excel表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆