尝试从 SharePoint 页面下载文件时出错

Getting error while trying to download a file from a SharePoint page

提问人:Paulo Felicio 提问时间:4/11/2019 最后编辑:CommunityPaulo Felicio 更新时间:4/11/2019 访问量:87

问:

我正在 SSIS 中制作一个脚本任务,以连接到 Sharepoint 网页并从那里下载文件。该脚本是 C# 语言,它正在抛出一个 execption。

当我执行它时,我收到错误:

Microsoft.SqlServer.ManagedDTS.dll 中发生类型为“System.NullReferenceException”的异常,但未在用户代码中处理

附加信息:对象引用未设置为对象的实例。

这是什么意思?

string FilePath = Dts.Variables["User::FilePath"].Value.ToString();
object obj = Dts.Connections["HTTP Connection Manager 1"].AcquireConnection(null);
HttpClientConnection HTTPConnection = new HttpClientConnection(obj);
HTTPConnection.DownloadFile(FilePath, true);


Dts.TaskResult = (int)ScriptResults.Success;
C# SQL Server SharePoint SSIS

评论

0赞 rvphx 4/11/2019
您可以访问该特定位置吗?该位置是否存在上述文件?
0赞 Hadi 4/11/2019
查看以下文章 techbrothersit.com/2016/07/...
0赞 rvphx 4/11/2019
我认为他正在关注同一篇文章。看起来很熟悉。
0赞 Paulo Felicio 4/11/2019
我正在检查这篇确切的文章,我什至在那里发表了一条评论,问了同样的问题,哈哈
0赞 Paulo Felicio 4/11/2019
回答你的问题,rvphx,我确实可以访问这个位置。并且该文件确实存在。我可以通过访问 URL 来访问它。

答: 暂无答案