简体   繁体   English

访问 Sharepoint 上的数据/文件 c# 在线

[英]Access data/file on Sharepoint Online in c#

I need to connect my web app to a sharepoint online.我需要将我的 web 应用程序连接到 sharepoint 在线。 I read a lot of example based on on-premise SHP ed it use a Sharepoint.DLL.我阅读了很多基于本地 SHP 的示例,它使用 Sharepoint.DLL。 So MS suggest to use Graph.所以 MS 建议使用 Graph。

My question is about best practice to implement this function:我的问题是关于实现这个 function 的最佳实践:

  • read a list of files/folder List item读取文件列表/文件夹列表项
  • create folder创建文件夹
  • (opt) upload document (opt) 上传文件

Best approach would be, develop a REST API flow using MS Flow... the MS Flow action would be when a http request comes.... then in the MS Flow handle the files reading and files uploading functionality and once you save the the flow you will get an automatic Azure REST API URL - this api you have to call from your c# code and need to pass the parameter to REST api.最好的方法是,使用 MS Flow 开发一个 REST API 流...... MS Flow 操作将是当 http 请求来时......然后在 MS Flow 中处理文件读取和上传功能。 flow you will get an automatic Azure REST API URL - this api you have to call from your c# code and need to pass the parameter to REST api. Note: 1.You may need to develop two MS Flow api one is for reading the items and another for uploading the document.注意: 1.您可能需要开发两台MS Flow api 一台用于读取项目,另一台用于上传文件。

If you want to access SharePoint Online data using C# in your web app, you could choose SharePoint Online CSOM library:如果您想在您的 web 应用程序中使用 C# 访问 SharePoint 在线数据,您可以选择 Z97F02F02F6993B9047632 在线 CSM 库

Microsoft.SharePointOnline.CSOM Microsoft.SharePointOnline.CSOM

Read List Item and other objects:读取列表项和其他对象:

How To Read Various Objects Using SharePoint Online Client Side Object Model (CSOM) 如何使用 SharePoint 在线客户端读取各种对象 Object Model (CSOM)

Create folder:创建文件夹:

Create Folder in SharePoint using CSOM 使用 CSOM 在 SharePoint 中创建文件夹

Upload document:上传文件:

CSOM. CSOM。 Upload document上传文件

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM