获取一份SharePoint Manager的副本,它可以向您显示大量有趣的信息。
您想要名称字段(它包括“.aspx”)。标题字段在 wiki(空白)中不相关,页面由他们的名称索引。
- 更新 -
使用 copy.asmx 允许您上传新文档。模板页面是之前下载过的页面(不存储任何信息,相当于一个布局页面)。
private byte[] GetTemplatePage()
{
FileStream fs = new FileStream("templatePage.aspx", FileMode.Open);
byte[] fileContents = new byte[(int)fs.Length];
fs.Read(fileContents, 0, (int)fs.Length);
fs.Close();
return fileContents;
}
private void UploadDoc(string pageName)
{
byte[] wikiBytes = GetTemplatePage();
string dest = "http://[website]/wiki/Wiki%20Pages/" + pageName + ".aspx";
string[] destinationUrlArray = new string[] { dest };
IntranetCopy.Copy copyService = new IntranetCopy.Copy();
copyService.UseDefaultCredentials = true;
copyService.Url = "http://[website]/wiki/_vti_bin/copy.asmx";
IntranetCopy.FieldInformation fieldInfo = new IntranetCopy.FieldInformation();
IntranetCopy.FieldInformation[] fields = { fieldInfo };
IntranetCopy.CopyResult[] resultsArray;
copyService.Timeout = 600000;
uint documentId = copyService.CopyIntoItems(dest, destinationUrlArray, fields, wikiBytes, out resultsArray);
}
然后您可以调用 lists.asmx 来更新 wikifield。注意:我还没有弄清楚如何在使用 web 服务上传文档后重命名文档。