社区
SharePoint
帖子详情
别人共享一个sharepoint的文件夹给我,我想用代码控制,怎么连接?
yingang11
2020-05-28 05:18:44
别人共享一个sharepoint的文件夹给我,我希望通过c#代码操作这个文件夹,例如:新建子目录,上传文件等
但是不清楚该怎么连接这个文件夹,地址类似这种:
https://zfhk.sharepoint.com/:f:/s/JIM-ExCom2/EhFbuaoeYWJLk8NH4NvKGl4BuTFGNRuaR1BnOQitYSqOEA?email=xxxx%40xxxxuuuu.com&e=dZvO6E
...全文
181992
5
打赏
收藏
别人共享一个sharepoint的文件夹给我,我想用代码控制,怎么连接?
别人共享一个sharepoint的文件夹给我,我希望通过c#代码操作这个文件夹,例如:新建子目录,上传文件等 但是不清楚该怎么连接这个文件夹,地址类似这种: https://zfhk.sharepoint.com/:f:/s/JIM-ExCom2/EhFbuaoeYWJLk8NH4NvKGl4BuTFGNRuaR1BnOQitYSqOEA?email=xxxx%40xxxxuuuu.com&e=dZvO6E
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
5 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
霖雨
版主
2021-03-09
打赏
举报
回复
上面的代码很靠谱
「已注销」
2020-08-06
打赏
举报
回复
可以使用 COMS API 操作,楼上的Code应该就可以
mslearn-nashma
2020-06-06
打赏
举报
回复
private static void UploadFileToSharePoint(string SiteUrl, string DocLibrary, string ClientSubFolder, string FileName, string Login, string Password) { try { #region ConnectToSharePoint var securePassword = new SecureString(); foreach (char c in Password) { securePassword.AppendChar(c); } var onlineCredentials = new SP.SharePointOnlineCredentials(Login, securePassword); #endregion #region Insert the data using (SP.ClientContext CContext = new SP.ClientContext(SiteUrl)) { CContext.Credentials = onlineCredentials; SP.Web web = CContext.Web; SP.FileCreationInformation newFile = new SP.FileCreationInformation(); byte[] FileContent = System.IO.File.ReadAllBytes(FileName); newFile.ContentStream = new MemoryStream(FileContent); newFile.Url = Path.GetFileName(FileName); SP.List DocumentLibrary = web.Lists.GetByTitle(DocLibrary); //SP.Folder folder = DocumentLibrary.RootFolder.Folders.GetByUrl(ClientSubFolder); SP.Folder Clientfolder = DocumentLibrary.RootFolder.Folders.Add(ClientSubFolder); Clientfolder.Update(); SP.File uploadFile = Clientfolder.Files.Add(newFile); CContext.Load(DocumentLibrary); CContext.Load(uploadFile); CContext.ExecuteQuery(); Console.ForegroundColor = ConsoleColor.Green; Console.WriteLine("The File has been uploaded"+Environment.NewLine+"FileUrl -->"+SiteUrl+"/"+DocLibrary+"/"+ClientSubFolder+"/" +Path.GetFileName(FileName)); } #endregion } catch (Exception exp) { Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine(exp.Message + Environment.NewLine + exp.StackTrace); } finally { Console.ReadLine(); } }
mslearn-nashma
2020-06-06
打赏
举报
回复
static void Main(string[] args) { string SiteUrl = "https://You.sharepoint.com/sites/Upload"; string DocumentLibrary = "UploadLibrary"; string FileName = @"C:\testupload.pdf"; string CustomerFolder = "1564_dsfgsst"; string UserName = "samir.daoudi@******.co.uk"; string Password = "*****"; UploadFileToSharePoint(SiteUrl, DocumentLibrary, CustomerFolder, FileName, UserName, Password); }
Justin-Liu
2020-06-02
打赏
举报
回复
你试试把这个文件夹用onedrive for business同步到本地,然后进行操作,网络畅通的话应该会自动同步
文件
共享
迁移/
SharePoint
Online迁移
通过本章课程的内容,可以清晰的了解本地文件
共享
的构成,权限的划分,以及如何规划和向Office 365 中的
SharePoint
Online以及OneDrive for Business迁移
C# 读写
共享
文件夹
中的文件
本例以读写INI配置文件为例进行说明。 在同一局域网内的一台电脑上创建
一个
共享
文件夹
,服务器ip地址是192.200.3.10,
共享
文件夹
名字是5656,INI配置文件名为publish;访问权限,用户名是PC,密码是12345678。 主程序
代码
: using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Diagnostics; usin
C#
Sharepoint
操作管理集合
C#
Sharepoint
操作管理集合
sharepoint
api 创建子站点网站
sharepoint
api 创建
文件夹
sharepoint
api 删除
文件夹
sharepoint
api 获取
文件夹
列表
sharepoint
api 文档版本
sharepoint
api 文档的元素值新增、编辑接口
sharepoint
api 删除文件 在一次项目中接触到了
sharepoint
的定制开发,去微软文档库中翻看API 文档时绝望了(小白吐槽),,,然后又在bing中去外国找相应的
sharepoint
api,
SharePoint
Online规划(一)
如果规划公司的
SharePoint
Online? 本文涉及如下情景: 1.从本地文件
共享
向
SharePoint
Online迁移 2.从
SharePoint
Server向
SharePoint
Online迁移 3.从Google Grive向
SharePoint
Online迁移 4.新使用
SharePoint
Online的企业 5.
SharePoint
Online与Microsoft T...
SharePoint
3,242
社区成员
4,604
社区内容
发帖
与我相关
我的任务
SharePoint
企业开发 SharePoint
复制链接
扫一扫
分享
社区描述
企业开发 SharePoint
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章