对于下面的CilentContext代码来在客户机中下载文档。当代码击中OpenBinaryDirect()方法时,我得到未经授权的401错误。下载文件时出现401错误 - SharePoint ClientContext
using (SPSite site = new SPSite(SPContext.Current.Web.Url, SPUserToken.SystemAccount))
{
using (FileInformation sharePointFile = Microsoft.SharePoint.Client.File.OpenBinaryDirect(clientContext, serverRelativeUrlOfFile))
{
using (Stream destFile = System.IO.File.OpenWrite(fileDestinationPath))
{
byte[] buffer = new byte[8 * 1024];
int byteReadInLastRead;
while ((byteReadInLastRead = sharePointFile.Stream.Read(buffer, 0, buffer.Length)) > 0)
{
destFile.Write(buffer, 0, byteReadInLastRead);
}
}
}
}
为什么会出现此错误的任何原因?