从CRM Online中的插件在Sharepoint中创建文件夹

本文关键字:Sharepoint 创建 文件夹 CRM Online 插件 | 更新日期: 2023-09-27 18:20:38

我必须使用CRM Online中的插件在sharepoint中创建一个文件夹,我做了这个方法,但我有一个错误:远程服务器返回了一个错误(403)禁止我的凭据是正确的,我有权创建文件夹。我可以从浏览器中完成。

谢谢你的帮助。

 private void CreateFolderInSharepoint(string folderUrl, ITracingService trace)
    {
        try
        {
 System.Net.NetworkCredential myCredential = new System.Net.NetworkCredential("username", "password");
            WebRequest request = WebRequest.Create(folderUrl);
            request.Credentials = myCredential;
            request.Method = "MKCOL";
            WebResponse response = request.GetResponse();
            response.Close();
        }
        catch (Exception ex)
        {
            trace.Trace(ex.ToString());
        }
    }

从CRM Online中的插件在Sharepoint中创建文件夹

参考本

www.wictorwilen.se/…/How-to-do-active-authentication-to-Office-365-andSharePoint-Online.aspx