【发布时间】:2017-03-20 09:11:34
【问题描述】:
我正在使用 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/
【问题讨论】:
标签: forms visual-studio-2012 sharepoint office365 infopath