如何找到要删除的附件文件名
ItemAttachmentDeleted,ItemAttachmentDeleting事件afterproperties和beforeproperties为空
答案 0 :(得分:1)
使用
string beforeUrl = properties.BeforeUrl;
string[] fileName = beforeUrl.Split('/');
string deletedfile = fileName[fileName.Length - 1];
答案 1 :(得分:0)
下面的代码为我们提供了第一个附件名称
SPFile attachment = properties.ListItem.ParentList.RootFolder.
SubFolders["Attachments"].SubFolders[properties.ListItemId.ToString()].
Files[properties.ListItem.Attachments.Count - 1];
string link = attachment.Name ;