2

我可以从在沙盒(部分信任)模式下运行的 CRM 2011 插件创建共享点文件夹吗?当不在沙盒隔离模式下运行时,有几种方法可以做到这一点,但在部分信任下运行时则不行。

WebRequest request = WebRequest.Create(FolderName);
request.Credentials = credentials;
request.Method = "MKCOL";
WebResponse response = request.GetResponse();
response.Close();


SPSite site = new SPSite(url);
SPWeb web = site.OpenWeb();
SPFolder folder = web.GetFolder(url + @"/" + "Contact/");
SPFolder createdFolder = folder.SubFolders.Add(FolderName);


HttpWebRequest httpreq = (HttpWebRequest)WebRequest.Create(FolderName);
httpreq.Credentials = credentials;
httpreq.Method = "MKCOL";
WebResponse response = httpreq.GetResponse();



Dws dwsService = new Dws();
dwsService.Credentials = credentials;
string dwsurl = url + "/_vti_bin/dws.asmx";
dwsService.Url = dwsurl;
string FolderName = "Contact/" + System.Uri.EscapeDataString(listName);
 string result = dwsService.CreateFolder(FolderName);
4

0 回答 0