【问题标题】:SharePoint online can't find SPSite, SPWeb, SPFolderSharePoint Online 找不到 SPSite、SPWeb、SPFolder
【发布时间】: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


    【解决方案1】:

    您不能在 SharePoint Online 上的 InfoPath 表单中运行代码。您根本不应该在 SharePoint Online 中使用 InfoPath。

    检查这个:https://sharepoint.stackexchange.com/questions/56617/can-i-use-infopath-code-behind-in-sharepoint-online

    【讨论】:

    • 好的,如果我无法在 InfoPath 中创建表单,也许您有任何想法如何在 SharePoint Online 中创建带有附件的表单并将它们放到另一个文件夹中?最好的问候
    猜你喜欢
    • 2015-10-11
    • 1970-01-01
    • 2014-02-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-06-20
    • 2019-07-21
    • 2012-04-07
    相关资源
    最近更新 更多