在实际生产中需要将sharepoint上的文件批量同步到网络盘或者其他需要同步的地方,下面我分两种情况来实现的:
我最近用Excel 的VBA写了一个应用,用户在excel上添加完数据后点击保存,但是只存储在sharepoint上这时希望一个定时任务能够将sharepoint的excel同步到网络盘上。(这是一个文件相对简单,后面的会有批量下载文件的功能实现)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.SharePoint.Client;
using System.Security;
using System.IO;
using System.Reflection;
using System.Net;
using iTextSharp.text;
using iTextSharp.text.pdf;
namespace Dict_Download
{
class Program
{
static void Main(string[] args)
{
string webSPOUrl = "sharepoint地址";
string userName = "账户名";
string passwordStr = "密码";
string listName = "同步的文件名";
//set SharePoint online Certification for password
SecureString passw