我正在使用InfoPath 2012,VIsual studio 2012和SharePoint online。我在infopath中创建表单,可以将文件保存到SP库中,我找到了本文的http://www.bizsupportonline.net/blog/2010/upload-document-sharepoint-infopath-form.htm,我在本文中做了所有这些,但是我不能将它连接到SPSite、SPWeb、SPFolder。这是导致错误的代码:
// Add the file to a document library
using (SPSite site = new SPSite("https://contoso.sharepoint.com/Blog/Shared%20Documents"))
{
using (SPWeb web = site.OpenWeb())
{
web.AllowUnsafeUpdates = true;
SPFolder docLib = web.Folders["Documents"];
docLib.Files.Add(fileName, data);
web.AllowUnsafeUpdates = false;
web.Close();
}
site.Close();
}也许有人有什么想法?我已经下载了dll库,但它无助于https://www.nuget.org/packages/Microsoft.SharePointOnline.CSOM/。
发布于 2017-03-20 10:01:41
不能在InfoPath online上以SharePoint窗体的形式运行代码。您不应该在在线的InfoPath中使用SharePoint。
https://stackoverflow.com/questions/42899581
复制相似问题