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

时间:2015-11-05 16:09:31

标签: c# sharepoint plugins dynamics-crm-2011

我必须使用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());
        }
    }

1 个答案:

答案 0 :(得分:0)

参考此

www.wictorwilen.se /.../如何到DO-活性认证到办公室-365和 - SharePoint的Online.aspx