本文介绍了无法从共享点删除文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
我正在尝试使用以下代码删除文件:
Hi All,
I am trying to delete a file by using this code:
StringBuilder sb = new StringBuilder();
sb.Append("<Method ID='1' Cmd='Delete'>");
sb.Append("<Field Name='ID'>"+DelID+"</Field>");
sb.Append("</Method>");
XmlDocument xmldoc = new XmlDocument();
XmlElement element = xmldoc.CreateElement("Batch");
element.SetAttribute("OnError", "Return");
element.InnerXml = sb.ToString();
Console.WriteLine("Program.cs - DeleteItemFromSP()-Removing Item from SharePoint which are not found ");
XmlNode xmlreturn = delList.UpdateListItems(strName.ToString().Trim(), element);
但这向我显示了一个错误.......
<结果ID = \"1,删除\" xmlns = \"http://schemas.microsoft.com/sharepoint/soap/\">< ErrorCode> 0x80070005</ErrorCode>< ErrorText>操作失败因为发生了意外错误. (结果代码:0x80070005)</ErrorText>
问候,
S.Inayat Basha.
But it was showing me a error.......
<Result ID=\"1,Delete\" xmlns=\"http://schemas.microsoft.com/sharepoint/soap/\"><ErrorCode>0x80070005</ErrorCode><ErrorText>The operation failed because an unexpected error occurred. (Result Code: 0x80070005)</ErrorText>
Regards,
S.Inayat Basha.
推荐答案
这篇关于无法从共享点删除文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!